Pagini recente » Statistici Maxim Georgiana (georgianamaxim) | Istoria paginii runda/simulare_oji_2023_clasa_10_16_martie/clasament | Cod sursa (job #2892956) | Solutia problemei shoturi | Cod sursa (job #1567221)
#include <iostream>
#include<fstream>
using namespace std;
int algoritm(int x,int y){
if(!y)
return x;
else
algoritm(x,x%y);}
int main()
{
int a,b;
long int n;
ifstream f("euclid2.in");
ofstream g("euclid2.out");
f>>n;
while(n){
f>>a>>b; g<< algoritm(a,b)<<endl;
n--;}
f.close();
g.close();
return 0;
}