Advertisement
Zyazev

Абитуриент 14г

Mar 15th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <string>
  4. using namespace std;
  5. struct EGE
  6. {
  7. string name;
  8. int number;
  9. int om,or,of;
  10. };
  11. void main()
  12. {
  13. setlocale(LC_ALL, "Russian");
  14. EGE e2017; int tri=0,chetire=0,pyat=0;
  15. ifstream fin("abit.txt");
  16. do
  17. {
  18. fin>>e2017.name;
  19. fin>>e2017.number;
  20. fin>>e2017.om>>e2017.or>>e2017.of;
  21. if (e2017.om==3)
  22. tri++;
  23. if (e2017.om==4)
  24. chetire++;
  25. if (e2017.om==5)
  26. pyat++;
  27. }while (!fin.eof());
  28. fin.close();
  29. cout<<"Общее количество оценок 3 по математике: "<<tri<<endl;
  30. cout<<"Общее количество оценок 4 по математике: "<<chetire<<endl;
  31. cout<<"Общее количество оценок 5 по математике: "<<pyat<<endl;
  32. system("pause");
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement