Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string>
- using namespace std;
- struct EGE
- {
- string name;
- int number;
- int om,or,of;
- };
- void main()
- {
- setlocale(LC_ALL, "Russian");
- EGE e2017; int tri=0,chetire=0,pyat=0;
- ifstream fin("abit.txt");
- do
- {
- fin>>e2017.name;
- fin>>e2017.number;
- fin>>e2017.om>>e2017.or>>e2017.of;
- if (e2017.om==3)
- tri++;
- if (e2017.om==4)
- chetire++;
- if (e2017.om==5)
- pyat++;
- }while (!fin.eof());
- fin.close();
- cout<<"Общее количество оценок 3 по математике: "<<tri<<endl;
- cout<<"Общее количество оценок 4 по математике: "<<chetire<<endl;
- cout<<"Общее количество оценок 5 по математике: "<<pyat<<endl;
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement