Cod sursa(job #2502040)
Utilizator | Data | 30 noiembrie 2019 12:44:20 | |
---|---|---|---|
Problema | Algoritmul lui Euclid | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.21 kb |
#include <fstream>
using namespace std;
ifstream fin ("cmmdc.in");
ofstream fout ("cmmdc.out");
int main()
{int a,b;
fin>>a>>b;
int r;
while(b>0){
r = a%b;
a = b;
b = r;
}
fout<<a;
}