WRITING A HARD PROGRAM!!
Ok
Last edited on
Last edited on
File input:
http://www.learncpp.com/cpp-tutorial/136-basic-file-io/
...
see 2nd example above link, then
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
string str[1001];
cin >> str[0]; // word to be searched
int n=0;
while(inf)
{
n++;
inf >> str[n];
}
for(int i =1; i<=n; i++)
{
if(str[i]==str[0])
{
cout << i << "th position\n";
}
}
cout <<"Search finish\n";
|
Topic archived. No new replies allowed.