Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <conio.h>
- #include <iomanip>
- #include <iostream>
- #include <stdio.h>
- #include <time.h>
- #include <string>
- #include <Windows.h>
- #include <math.h>
- #include <fstream>
- using namespace std;
- struct
- {
- string name;
- int scount,fcount,kcount;
- } mas[4];
- ifstream fin;
- ofstream fout;
- int main()
- {
- fin.open("in.txt");
- for (int i = 0; i <4; i++)
- {
- fin >> mas[i].name;
- fin >> mas[i].scount;
- fin >> mas[i].fcount;
- fin >> mas[i].kcount;
- }
- fin.close();
- fout.open("out.txt");
- fout << "Данные о вузе с максимальным числом студентов: \n";
- int k = 0;
- int ind = 0;
- for (int i = 0; i < 4; i++){
- if (mas[i].scount > k){
- k = mas[i].scount;
- ind = i;
- }
- }
- fout << mas[ind].name<< " ";
- fout << mas[ind].scount<< " ";
- fout << mas[ind].fcount<< " ";
- fout << mas[ind].kcount<< " \n";
- fout.close();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement