Advertisement
Josif_tepe

Untitled

Mar 20th, 2022
727
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.52 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <ctype.h>
  4.  
  5. struct student {
  6.     char ime[50];
  7.     char prezime[50];
  8.     int godini;
  9. };
  10. void print(struct student s) {
  11.     printf("%s %s %d\n", s.ime, s.prezime, s.godini);
  12. }
  13. int main() {
  14.     int n;
  15.     scanf("%d", &n);
  16.    
  17.     struct student students[n];
  18.    
  19.     for(int i = 0; i < n; i++) {
  20.         scanf("%s%s%d", students[i].ime, students[i].prezime, &students[i].godini);
  21.     }
  22.     for(int i = 0; i < n; i++) {
  23.         print(students[i]);
  24.     }
  25.    
  26. }
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement