Advertisement
Josif_tepe

Untitled

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