Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <cmath>
  4. #include <cstring>
  5. #include <cstdlib>
  6. #include <string>
  7. #include <vector>
  8. using namespace std;
  9.  
  10. class Day
  11. {
  12. public:
  13. string name;
  14. string surname;
  15. int age;
  16. string number;
  17.  
  18. Day(string n = "vdsv", string surn = "gsdg", int a = 10, string num = "asd"): name(n), surname(surn), age(a), number(num) { }
  19. Day read() {
  20. string n, surn, num;
  21. int a;
  22. cin >> n;
  23. cin >> surn;
  24. cin >> a;
  25. cin >> n;
  26. return Day(n, surn, a, num);
  27. }
  28. };
  29.  
  30. int main() {
  31. int n;
  32. cin >> n;
  33. Day * mas = new Day[n];
  34. for (int i = 0; i < n; i++) {
  35. Day d;
  36. mas[i] = d.read();
  37. }
  38. int q;
  39. int p = 0;
  40. cin >> q;
  41. for(int i = 0; i < n; i++){
  42. if(mas[i].age > q){
  43. cout << mas[i].name << " " << mas[i].surname << endl;
  44. p++;
  45. }
  46. }
  47. if(p == 0)
  48. cout << "There are no adult students";
  49. return 0;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement