using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int sayi1,sayi2,ebob,ekok;
Console.WriteLine("1.sayıyı giriniz");
sayi1=Convert.ToInt16(Console.ReadLine());
Console.WriteLine("2.sayıyı girniz");
sayi2=Convert.ToInt16(Console.ReadLine());
ebob = eb(sayi1, sayi2);
ekok = ek(sayi1, sayi2);
Console.WriteLine("ebob'u=" + ebob);
Console.WriteLine("ekok,u=" + ekok);
Console.ReadLine();
}
static int eb(int x,int y)
{
int a=2,sonuc=0;
for (;x%a==0 && y%a==0; a++)
{
sonuc =a*a;
}
return sonuc;
}
static int ek(int x, int y)
{
int a,eko=1;
if (x>y)
{
a = x;
}
else
{
a = y;
}
for (int i = 2; i <= a;)
{
if ((x%i==0)&&(y%i==0))
{
eko *= i;
x /= i;
y /= i;
}
else if ((x % i != 0) && (y % i == 0))
{
eko *= i;
y /= i;
}
else if ((x % i == 0) && (y % i != 0))
{
eko *= i;
x /= i;
}
else if ((x % i != 0) && (y % i != 0))
{
i++;
}
}
return eko;
}
}
}