SHARE
TWEET

Untitled

a guest Jan 17th, 2020 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.util.Scanner;
  2. public class zadacha8 {
  3.     public static Scanner scan = new Scanner(System.in);
  4.     public static void main(String args[]) {
  5.         int number, min = 100;
  6.         number = scan.nextInt();
  7.         int[][] matr = new int[number][number];
  8.         for(int i = 0; i < number; i++) {
  9.             for(int j = 0; j < number; j++){
  10.                 matr[i][j] = scan.nextInt();
  11.             }
  12.         }
  13.         for(int i = 0; i < number; i++){
  14.             for(int j = 0; j < number; j++){
  15.                 if( j == number - 1 - i){
  16.                     min = Math.min(matr[i][j], min);
  17.                 }
  18.             }
  19.         }
  20.         for(int i = 0; i < number; i++){
  21.             for(int j = 0; j < number; j++){
  22.                 if (matr[i][j] == 0){
  23.                     matr[i][j] = min;
  24.                 }
  25.                 System.out.println(matr[i][j]);
  26.             }
  27.             System.out.println();
  28.         }
  29.     }
  30. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top