刘汝佳算法入门之第二章之习题之三

#define LOCAL

#include<stdio.h>

int main()

{

#ifdef LOCAL

freopen("E:\\c\\input1.txt","r",stdin);

freopen("E:\\c\\output.txt","w",stdout);

#endif

int x,y,z,i,j=0;

while(scanf("%d%d%d",&x,&y,&z)==3)

{

for(i=10;i<=100;i++)

{

if(i%3==x&&i%5==y&&i%7==z) {j=i;printf("%d\n",j);}

}

if(j==0) printf("No answer\n");

}

return 0;

}

posted on 2011-10-11 10:30  csushin  阅读(125)  评论(0)    收藏  举报