- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathString Finder.cpp
More file actions
Latest commit
29 lines (28 loc) · 628 Bytes
/
Copy pathString Finder.cpp
File metadata and controls
29 lines (28 loc) · 628 Bytes
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
//This program is written by BALAJI G
#include<bits/stdc++.h>
usingnamespacestd;
int n;
voidfun(string a[],string b[])
{ for(int j=0;j<n;j++)
{int count=0;
size_t pos = a.find(b[j], 0);
while(pos != string::npos)
{ count++;
pos = a.find(b[j], pos+1);
}if(count==0)
cout<<a;
}
}
intmain()
{
string a;
cout<<"ENTER A SENTENCE::"<<endl;
getline(cin,a);
cout<<"ENTER THE NUMBER OF WORDS YOU KNOW::"<<endl;
cin>>n;
cout<<"ENTER THE WORDS YOU KNOW::"<<endl;
string b[n];
for(int i=0;i<n;i++)
cin>>b[i];
fun(a,b);
}