I don't know what is problem
package pl.codegym.task.task14.task1420;
import java.io.BufferedReader;
import java.io.InputStreamReader;
/*
NWD
*/
public class Solution {
public static void main(String[] args) throws Exception {
int NWD = 1;
try (BufferedReader br = new BufferedReader( new InputStreamReader ( System.in))){
int liczna_1 = Integer.parseInt(br.readLine());
int liczna_2 = Integer.parseInt(br.readLine());
if(!(liczna_1 > 0 && liczna_2 > 0))
throw new NumberIsNotPosityveException("Number is not posityve");
if(liczna_1 > liczna_2)
{
int x = liczna_1;
liczna_1 = liczna_2;
liczna_2 = x;
}
for(int i=1; i<=liczna_1; i++)
if(liczna_1%i == 0 && liczna_2%i == 0)
NWD = i;
System.out.println(NWD);
}
catch(NumberIsNotPosityveException e)
{System.out.println(e);}
}
}
class NumberIsNotPosityveException extends Exception{
public NumberIsNotPosityveException(String message){
super(message);
}
}