Advertisement
Guest User

mladi, najmladi

a guest
Apr 26th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. #ifndef DEBUG
  4. #define DEBUG(...)printf(_VA_ARGS_)
  5. #endif
  6.  
  7. #define MAXA 200
  8.  
  9. int main() {
  10. int n;
  11. int br = 0; // broj mladih
  12. int mn = 100; // godine starosti najmladje osobe
  13. int *pbr=NULL, *pmn=NULL;
  14.  
  15. pbr = &br;
  16. pmn = &mn;
  17.  
  18. int god;
  19.  
  20. scanf("%d ", &n);
  21.  
  22.  
  23. for (int i = 0; i < n; i++) {
  24.  
  25. scanf("%d", &god);
  26.  
  27.  
  28. if ((god > 10) && (god < 30)) {
  29. (*pbr)++;
  30.  
  31. }
  32. if (god < *pmn) {
  33. *pmn = god;
  34. }
  35. }
  36.  
  37. printf("%d\n", *pbr);
  38. printf("%d", *pmn);
  39.  
  40. return 0;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement