Advertisement
Guest User

radojko

a guest
May 21st, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4.  
  5. typedef struct
  6. {
  7. char ime[31];
  8. int starost;
  9.  
  10. }osoba;
  11.  
  12. void citaj(osoba *a)
  13. {
  14. gets((*a)ime);
  15. scanf("%d"&(*a) starost);
  16. }
  17.  
  18. void pisi(osoba a)
  19. {
  20. printf("%s %d\n", a ime, a starost);
  21. }
  22.  
  23.  
  24. int main(){
  25. osoba o1,o2,o3,najstariji;
  26. citaj(&o1);
  27. citaj(&o2);
  28. citaj(&o3);
  29. najstariji=o1
  30. if(najstariji.starost<o2.starost)najstariji=o2;
  31. if(najstariji.starost<o3.starost)najstariji=o3;
  32. printf("%d",najstariji.ime);
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement