Cod sursa(job #3255132)
Utilizator | Data | 9 noiembrie 2024 15:18:01 | |
---|---|---|---|
Problema | Algoritmul lui Euclid | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.25 kb |
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
int a,b,r;
ifstream f("euclid2.in");
ofstream o("euclid2.out");
f>>a>>b;
while (b!=0) {
r = a%b;
a = b;
b = r;
}
o<<a;
}