Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <fstream>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. ifstream fin;
  9. string file, name, bin;
  10. int k, x;
  11. cin >> file;
  12. cin >> k;
  13. fin.open(file);
  14. do {
  15. fin >> name;
  16. fin >> x;
  17. getline(fin, bin);
  18. if (x == k) {
  19. cout << name << '\n';
  20. }
  21. } while (!fin.eof());
  22. fin.close();
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement