Mai intai trebuie sa te autentifici.
Cod sursa(job #2446744)
Utilizator | Data | 10 august 2019 17:10:23 | |
---|---|---|---|
Problema | A+B | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.34 kb |
#include <fstream>
using namespace std;
int main()
{
ifstream f ("euclid2.in");
ofstream g ("euclid2.out");
int a, b, r, n;
f>>n;
for(int i=1; i<=n; i++)
{
f>>a>>b;
while(b!=0)
{
r=a%b;
a=b;
b=r;
}
g<<a<<'\n';
}
}