Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. #include <iostream>
  2. #include <locale>
  3. using namespace std;
  4.  
  5. struct Student {
  6. string name, inic;
  7. int date, month, year;
  8. };
  9.  
  10.  
  11. int main() {
  12. setlocale(LC_ALL, "");
  13. int n;
  14. char separator = '.';
  15. cout << "Введите количество:\n";
  16. cin >> n;
  17. Student* arr = new Student[n];
  18. cout << "Вводите студентов:\n";
  19. for (int i = 0; i < n; ++i) {
  20. Student a;
  21. cin >> a.name >> a.inic >> a.date >> separator >> a.month >> separator >> a.year;
  22. arr[i] = a;
  23. }
  24. for (int i = 0; i < n; ++i) {
  25. if (arr[i].month >= 3 && arr[i].month <= 5) cout << arr[i].name << " " << arr[i].inic << "\n";
  26. }
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement