Cod sursa(job #1484032)
Utilizator | Data | 10 septembrie 2015 13:10:12 | |
---|---|---|---|
Problema | Algoritmul lui Euclid | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.32 kb |
#include <iostream>
#include <ftsream>
using namespace std;
ifstream in("data.in")
ofstream out("data.out")
int main()
{
ifstream in("data.in")
ofstream out("data.out")
int a, b;
in>>a>>b;
while(a!=b)
if(a>b)
a=a-b;
else b=b-a;
out<< b ;
return 0;
}