FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
C-Plus-Plus/search/searching.cpp at master · SelfCodeLearning/C-Plus-Plus · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
SelfCodeLearning
/
C-Plus-Plus
Public
forked from
TheAlgorithms/C-Plus-Plus
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
C-Plus-Plus
/
search
/
searching.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
40 lines (37 loc) · 1.09 KB
Breadcrumbs
C-Plus-Plus
/
search
/
searching.cpp
Copy path
File metadata and controls
40 lines (37 loc) · 1.09 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#
include
<
iostream
>
#
include
<
string
>
#
include
<
cstdlib
>
using
namespace
std
;
char
paragraph;
int
main
()
{
string paragraph;
cout <<
"
Please enter your paragraph:
\n
"
;
getline
(cin, paragraph);
cout <<
"
\n
Hello, your paragraph is:
\n
"
<< paragraph <<
"
!
\n
"
;
cout <<
"
\n
The size of your paragraph =
"
<< paragraph.
size
() <<
"
characters.
\n\n
"
;
if
(paragraph.
empty
())
{
cout <<
"
\n
The paragraph is empty
"
<< endl;
}
else
{
while
(
true
)
{
string word;
cout <<
"
Please enter the word you are searching for:
"
;
getline
(cin, word);
cout <<
"
Hello, your word is
"
<< word <<
"
!
\n
"
;
if
(paragraph.
find
(word) == string::npos)
{
cout << word <<
"
does not exist in the sentence
"
<< endl;
}
else
{
cout <<
"
The word
"
<< word <<
"
is now found at location
"
<< paragraph.
find
(word) << endl
<< endl;
}
system
(
"
pause
"
);
}
}
}
Back
|
FazBrowse Home
|
New Git URL