Advertisement
Josif_tepe

Untitled

Apr 26th, 2021
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.54 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Student {
  5. public:
  6.     int indeks;
  7.     char ime[50];
  8.     char prezime[50];
  9.    
  10.     void input() {
  11.         cin >> indeks >> ime >> prezime;
  12.     }
  13.     void print() {
  14.         cout << "Ime: " << ime << " Prezime: " << prezime << " Indeks: " << indeks << endl;
  15.     }
  16.    
  17. };
  18. int main() {
  19.     int n;
  20.     cin >> n;
  21.     Student niza[n];
  22.     for(int i = 0; i < n; i++) {
  23.         niza[i].input();
  24.     }
  25.     for(int i = 0; i < n; i++) {
  26.         niza[i].print();
  27.     }
  28.    
  29.    return 0;
  30. }
  31.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement