Cod sursa(job #2340610)
Utilizator | Data | 10 februarie 2019 18:59:01 | |
---|---|---|---|
Problema | Algoritmul lui Euclid | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva educationala | Marime | 0.36 kb |
// Algoritmul lui Euclid.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include "pch.h"
#include <iostream>
using namespace std;
int main()
{
int t;
int a, b;
cin >> t;
while (t-- != 0) {
cin >> a >> b;
int aux;
while (b) {
aux = a % b;
a = b;
b = aux;
}
cout << a << '\n';
}
}