Задача решена, решение выдает правильное. Преобразование завернул в трай/кетч с выкидыванием исключения, а валидатор ругается.
package com.javarush.task.task14.task1420;
/*
НОД
*/
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Solution {
static int div;
static int a;
static int b;
public static void main(String[] args) throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
try {
a = Integer.parseInt(reader.readLine());
b = Integer.parseInt(reader.readLine());
} catch (NumberFormatException | IOException e) {
e.printStackTrace();
}
nod(a, b);
}
public static void nod(int a, int b) {
if (a < b) {
div = a;
a = b;
b = div;
div = 0;
}
while (b != 0) {
div = a % b;
a = b;
b = div;
}
System.out.println(a);
}
}