Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- // main.cpp
- // word-lab
- //
- // Created by Nikita Korvyakov on 12.12.2019.
- // Copyright © 2019 Nikita Korvyakov. All rights reserved.
- //
- #include <iostream>
- #include <fstream>
- using namespace std;
- int main(int argc, const char * argv[]) {
- ifstream fin;
- fin.open("test.txt");
- int count = 0;
- string s;
- while(fin >> s){
- count++;
- }
- fin.close();
- cout << "Количество слов: " << count << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement