fork download
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. struct Student {
  6. string fam, name;
  7. int m, f, i;
  8. };
  9.  
  10. int main() {
  11. int n;
  12. cin >> n;
  13. Student a[n];
  14.  
  15. for(int i = 0; i < n; i++) {
  16. cin >> a[i].fam >> a[i].name >> a[i].m >> a[i].f >> a[i].i;
  17. }
  18. for(int i = 0; i < n; i++) {
  19. if (a[i].m > 3 && a[i].f > 3 && a[i].i > 3) {
  20. cout << a[i].fam << " " << a[i].name << endl;
  21. }
  22. }
  23. return 0;
  24. }
  25.  
Success #stdin #stdout 0.01s 5296KB
stdin
3
Babat Anna 5 4 3
Belova Galina 4 3 5
Moroz Yaroslav 3 5 4
stdout
Standard output is empty