Cod sursa(job #1637395)
Utilizator | Data | 7 martie 2016 17:02:00 | |
---|---|---|---|
Problema | Algoritmul lui Euclid | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.24 kb |
#include <fstream>
#include <cmath>
using namespace std;
int main()
{unsigned int a,b;
ifstream x("cmmdc.in");
ofstream y("cmmdc.out");
x>>a;
x>>b;
x.close();
while(a!=b){if(a>b) a=a-b; else b=b-a;}
y<<a;
y.close();
return 0;
}