#include<stdio.h> int main() { int a,b,max,min,gys,gbs; scanf("%d %d",&a,&b); if(a>b){a=max;b=min;} else if(a<b){b=max;a=min;} for(i=min;i>=1;i--) { if(a%i==0&&b%i==0) gys=i; break; } for(j=max;;j++) { if(j%a==0&&j%b==0) gbs=j; break; } printf("%d %d",gys,gbs); return 0; } /* Main.c: In function 'main': Main.c:8:7: error: 'i' undeclared (first use in this function) for(i=min;i>=1;i--) ^ Main.c:8:7: note: each undeclared identifier is reported only once for each function it appears in Main.c:14:7: error: 'j' undeclared (first use in this function) for(j=max;;j++) ^ */ |
Double click to view unformatted code.