Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int[][] arr = new int[10][10];
- for(int i = 0; i < 10; i++) {
- for(int j = 0; j < 10; j++) {
- arr[i][j] = (int)(Math.random() * 10);
- System.out.print(arr[i][j] + " ");
- }
- System.out.println("");
- }
- int min = 101, sum = 0;
- for(int i = 0; i < 10; i++) {
- sum = 0;
- for(int j = 0; j < 10; j++)
- sum += arr[i][j];
- if(sum < min)
- min = sum;
- }
- for(int i = 0; i < 10; i++) {
- sum = 0;
- for(int j = 0; j < 10; j++)
- sum += arr[i][j];
- if(sum == min)
- System.out.println(i+1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement