Pagini recente » Cod sursa (job #2770908) | Cod sursa (job #846381) | Cod sursa (job #1129706) | Cod sursa (job #2944184) | Cod sursa (job #846038)
Cod sursa(job #846038)
#include <stdio.h>
void OpenFiles(int);
int Cmmdc(int,int);
int main(int arg,char *argv[])
{
OpenFiles(arg);
int n,x,y;
scanf("%d",&n);
while(n--)
{
scanf("%d %d",&x,&y);
printf("%d\n",Cmmdc(x,y));
}
return 0;
}
int Cmmdc(int x,int y){
if(y==0)return x; else return Cmmdc(y,x%y);
}
void OpenFiles(int arg){
freopen("test.in","r",stdin);
if(arg<=199)
{
freopen("test.out","w",stdout);
}
}