Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h
- #include <time.h>
- #define N 10
- #define M 10
- int main()
- {
- tab[N][M];
- int ilosc=0;
- int ilosc_max=0;
- int kolumna;
- int kolumna_max=0;
- srand(time(NULL));
- for(int i=0;i<N;i++)
- {
- for(int j=0;j<M;j++)
- {
- tab[i][j]=rand()%50+1;
- }
- }
- for (int j=0;j<M;j++)
- {
- for(int i=0;i<N;i++)
- {
- kolumna=j;
- if(tab[i][j]%2==0)
- {
- ilosc=ilosc+1;
- }
- if(ilosc>ilosc_max)
- {
- ilosc_max=ilosc;
- kolumna_max=kolumna;
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement