Cod sursa(job #2756042)

Utilizator helloworld0107Iordachi Bianca helloworld0107 Data 29 mai 2021 11:23:42
Problema Algoritmul lui Euclid Scor 0
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.23 kb
#include <iostream>

using namespace std;
int main()
{
int a, b, t, rest;
cin >> t;
for (int i = 1; i <= t; i++)
 {
 cin >> a >> b;
  while (b != 0)
   {
     rest = a % b;
     a = b;
     b = rest;
   }
   cout << a ;
 } 
 return 0;
}