import java.util.Scanner; public class evklid{ public static void main(String[] args) { Scanner in = new Scanner(System.in); System.out.println("Введите первое число: "); int num1 = in.nextInt(); System.out.println("Введите второе число: "); int num2 = in.nextInt(); int tempor, result, reminder; tempor = Math.max(num1, num2); result = Math.min(num1, num2); while ((reminder = tempor % result) != 0) { tempor = result; result = reminder; } System.out.println("НОД равен "+result); } }