fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. class Student
  4. {
  5. public:
  6. string name;
  7. int roll;
  8. int marks;
  9. };
  10. int main()
  11. {
  12. int n;
  13. cin >> n;
  14. Student a[n];
  15. for(int i=0; i<n; i++)
  16. {
  17. cin >> a[i].name >> a[i].roll >> a[i].marks;
  18. }
  19. for(int i=0; i<n; i++)
  20. {
  21. cout << a[i].name << " " << a[i].roll << " " << a[i].marks << endl;
  22. }
  23. return 0;
  24. }
Success #stdin #stdout 0s 5312KB
stdin
5
l 7 8
l 4 5
m 4 5
d 6 9
c 5 8
stdout
l 7 8
l 4 5
m 4 5
d 6 9
c 5 8