Cod sursa(job #2484811)
Utilizator | Data | 31 octombrie 2019 17:10:59 | |
---|---|---|---|
Problema | Algoritmul lui Euclid | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.25 kb |
#include<fstream>
using namespace std;
ifstream fin("");
ofstream fout("");
int main(){
int n,x,y;
fin>>n;
for(int i=1;i<=n;i++){
fin>>x>>y;
while(y!=0){
x=y;
y=x%y;
}
fout<<x<<" ";
}
}