#include<stdio.h>
int main()
{
int n, m, a, rem, i;
scanf("%d", &a);
for(i=1;i<=a;i++)
{
scanf("%d %d", &n, &m);
while(m != 0)
{
rem = n % m;
n = m;
m = rem;
}
printf("%d\n", n);
}
return 0;
}
int main()
{
int n, m, a, rem, i;
scanf("%d", &a);
for(i=1;i<=a;i++)
{
scanf("%d %d", &n, &m);
while(m != 0)
{
rem = n % m;
n = m;
m = rem;
}
printf("%d\n", n);
}
return 0;
}
Comments
Post a Comment