Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string>
- using namespace std;
- struct date
- {
- int day;
- int month;
- int year;
- };
- struct pupil
- {
- char name[15];
- int score;
- };
- struct ss
- {
- int group;
- string subject;
- char teacher[15];
- date edate;
- pupil epupil;
- };
- void main()
- {
- setlocale(LC_ALL, "Russian");
- ss exam; double k=0;
- ifstream fin("vdm.txt");
- while(!fin.eof())
- {
- fin>>exam.group; cout<<exam.group<<" ";
- fin>>exam.subject; cout<<exam.subject<<" ";
- fin>>exam.teacher; cout<<exam.teacher<<" ";
- fin>>exam.edate.day; cout<<exam.edate.day<<".";
- fin>>exam.edate.month; cout<<exam.edate.month<<".";
- fin>>exam.edate.year; cout<<exam.edate.year<<endl;
- for (int i=0; i<15; i++)
- {
- fin>>exam.epupil.name; cout<<exam.epupil.name<<" ";
- fin>>exam.epupil.score;
- if (exam.epupil.score>=56&&exam.subject=="Матанализ")
- k++;
- cout<<exam.epupil.score<<endl;
- }
- }
- fin.close();
- cout<<k/double(45)*100<<" процентов студентов успешно сдали матанализ"<<endl;
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement