Cod sursa(job #3242217)
Utilizator | Data | 9 septembrie 2024 23:14:13 | |
---|---|---|---|
Problema | Algoritmul lui Euclid | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.31 kb |
#include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
freopen("euclid2.in", "r", stdin);
freopen("euclid2.out", "w", stdout);
int n, c; cin>>n;
int a, b;
while(n--){
cin>>a>>b;
while(b > 0){
c = a % b;
a = b;
b = c;
}
}
cout<<b;
}