Cod sursa(job #2278727)
Utilizator | Data | 8 noiembrie 2018 15:04:56 | |
---|---|---|---|
Problema | Algoritmul lui Euclid | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.27 kb |
#include<fstream>
using namespace std;
int euclid(int a, int b)
{
int r=1;
while(r)
{
r=a%b;
a=b;
b=r;
}
return a;
}
int main()
{
ifstream cin("euclid2.in");
ofstream cout("euclid2.out");
int a,b;
cin>>a>>b;
cout<<euclid(a,b);
}