Cod sursa(job #1196718)
Utilizator | Data | 8 iunie 2014 23:42:19 | |
---|---|---|---|
Problema | Loto | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.45 kb |
#include <iostream>
#include <fstream>
using namespace std;
int main ()
{
ifstream si("euclid2.in.txt");
ofstream so("euclid2.out.txt");
int contor,a,b;
si>>contor;
for(contor;contor;--contor)
{
si>>a>>b;
while (a!=b)
{
if (a>b)
a=a-b;
else
b=b-a;
}
so<<a<<"\n";
}
return 0;
}