Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <fstream>
- #include <string>
- using namespace std;
- bool check = true;
- int main()
- {
- setlocale(LC_ALL, "russian");
- string *arr = new string[100];
- char ch=0;
- string inf;
- int n = 0;
- fstream kpop;
- kpop.open("kpop.txt", ios::in);
- while (!kpop.eof())
- {
- getline(kpop, inf, ' ');
- cout << inf << " ";
- for (int i = 0; i < inf.length(); i++) {
- ch=inf[i];
- if (((ch >= ' ')&&(ch <= '@')) || ((ch >= '0')&&(ch <= '9'))) {
- check = false;
- break;
- }
- else check = true;
- }
- if (check == true) {
- arr[n] = inf;
- n++;
- }
- }
- kpop.close();
- if (n < 3) cout << endl << arr[0] << endl;
- else
- cout << endl << arr[n - 3] << endl;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement