josiftepe

Untitled

Nov 15th, 2020
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. // korisnikot ni vnesuva eden broj n, i treba da vneseme za n studenti nivnoto ime, prezime, broj_na_indeks i prosek
  5. struct student{
  6.     string ime;
  7.     string prezime;
  8.     int broj_na_indeks;
  9.     double prosek;
  10.    
  11. };
  12.  
  13. int main()
  14. {
  15.     int n;
  16.     cin >> n;
  17.     student niza[n];
  18.     for(int i = 0; i < n; i++) {
  19.         cin >> niza[i].ime ;
  20.         cin >> niza[i].prezime;
  21.         cin >> niza[i].broj_na_indeks;
  22.         cin >> niza[i].prosek;
  23.        
  24.     }
  25.     for(int i = 0; i < n; i++) {
  26.         cout << niza[i].ime << " " << niza[i].prezime << " " << niza[i].broj_na_indeks << " " << niza[i].prosek << endl;
  27.     }
  28.     return 0;
  29. }
  30.  
Advertisement
Add Comment
Please, Sign In to add comment