Advertisement
Guest User

Untitled

a guest
Jan 21st, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h
  3. #include <time.h>
  4. #define N 10
  5. #define M 10
  6.  
  7.  
  8.  
  9.  
  10. int main()
  11. {
  12. tab[N][M];
  13. int ilosc=0;
  14. int ilosc_max=0;
  15. int kolumna;
  16. int kolumna_max=0;
  17. srand(time(NULL));
  18. for(int i=0;i<N;i++)
  19. {
  20. for(int j=0;j<M;j++)
  21. {
  22. tab[i][j]=rand()%50+1;
  23. }
  24. }
  25. for (int j=0;j<M;j++)
  26. {
  27. for(int i=0;i<N;i++)
  28. {
  29. kolumna=j;
  30. if(tab[i][j]%2==0)
  31. {
  32. ilosc=ilosc+1;
  33. }
  34. if(ilosc>ilosc_max)
  35. {
  36. ilosc_max=ilosc;
  37. kolumna_max=kolumna;
  38. }
  39. }
  40. }
  41.  
  42.  
  43. return 0;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement