Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main() {
- int n, m;
- scanf("%d%d", &n, &m);
- int matrica[n][m];
- for(int i = 0; i < n; i++) {
- for(int j = 0; j < m; j++) {
- scanf("%d", &matrica[i][j]);
- }
- }
- int najmal_zbir = 2000000000; // 2 milijardi(bilioni)
- int indeks = -1;
- for(int j = 0; j < m; j++) {
- int zbir = 0;
- for(int i = 0; i < n; i++) {
- zbir += matrica[i][j];
- }
- if(zbir < najmal_zbir) {
- najmal_zbir = zbir;
- indeks = j;
- }
- }
- printf("%d\n", indeks + 1);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement