1 #include<stdio.h> 2 int main() 3 { 4 int a,b,c,n,t; 5 while(~scanf("%d%d%d",&a,&b,&c)) 6 { 7 for(n=10,t=0; n<=100; n++) 8 if(n%3==a&&n%5==b&&n%7==c) 9 t=n; 10 if(t) 11 printf("%d ",t); 12 else 13 printf("No answer "); 14 } 15 return 0; 16 } 17
1 #include<stdio.h> 2 int main() 3 { 4 int a,b,c,n,t; 5 while(~scanf("%d%d%d",&a,&b,&c)) 6 { 7 for(n=10,t=0; n<=100; n++) 8 if(n%3==a&&n%5==b&&n%7==c) 9 t=n; 10 if(t) 11 printf("%d ",t); 12 else 13 printf("No answer "); 14 } 15 return 0; 16 } 17