#include<iostream>
#include<fstream>
using namespace std;
int main(){
string word;
int count=0;
ifstream file;
file.open("newfile1.txt");
while (file>>word)
{
cout<<word<<endl;
count++;
}
cout<<"\n words in total are "<<count<<endl;
file.close();
return 0;
}
No comments:
Post a Comment