kokokozhina

Untitled

Dec 10th, 2015
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.99 KB | None | 0 0
  1. #include <iostream> //exercise 1
  2. #include <string> //create structure STUDENT, which includes full name, birth's year, marks for session
  3. #include <vector> //output - names of students, which average mark is higher than predetermined number
  4. #include <fstream>
  5.  
  6. using namespace std;
  7.  
  8. struct Student
  9. {
  10.         Student(){};
  11.         ~Student(){};
  12.         string surname, name, patrinymic_name;
  13.         int birth_year;
  14.         vector<int> marks;
  15.         Student(string surname, string name, string patrinymic_name, int birth_year) : surname(surname), name(name), patrinymic_name(patrinymic_name), birth_year(birth_year) {};
  16.        
  17. };
  18.  
  19.  
  20. int main()
  21. {
  22.     ifstream in("input.txt");
  23.     ofstream out("output.txt");
  24.    
  25.     vector<Student> student;
  26.  
  27.     int n;
  28.     cout << "Enter the border: ";
  29.     cin >> n;
  30.     while(in.peek() != EOF)
  31.     {
  32.         string surname, name, patrinymic_name;
  33.         int birth_year;
  34.         in >> surname;
  35.         in >> name;
  36.         in >> patrinymic_name;
  37.         in >> birth_year;
  38.         student.push_back(Student());
  39.     }
  40.  
  41.  
  42.     system("pause");
  43.     return 0;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment