using System;
using System.Collections.Generic;
using System.Text;
namespace Zadacha1
{
class Program
{
// Решаем задачу с помощью Алгоритма Евклида с вычитанием
static void Main()
{
//Объявляем переменные без инициализации
int i, j, s;
//Вводим переменные
Console.Write("Введите x: ");
string x = Console.ReadLine();
i = Convert.ToInt32(x);
Console.Write("Введите y: ");
string y = Console.ReadLine();
j = Convert.ToInt32(y);
//Задаем цикл, в котором из двух чисел выбирается
//наибольшее и заменяется разностью этих чисел
while (i != j)
{
if (i >= j) i -= j;
else j -= i;
}
//Выводим Наибольший Общий Делитель
if (i > j) Console.WriteLine("НОД = " + j);
else Console.WriteLine("НОД = " + i); return;
}
}
}