输入输出的重定位:
#include <stdio.h> int result(int a,int b,int c) { for(int i=10;i<100;i++) if((i%3==a)&&(i%5==b)&&(i%7==c)) return i; return 0; } int main() { freopen("Debug\\input.txt","r",stdin); freopen("Debug\\output.txt","w",stdout); int x,a,b,c,m,kase=0; while(scanf("%d %d %d",&a,&b,&c)!=EOF) { m=result(a,b,c); if(kase) printf("\n"); if(m!=0) printf("Case %d: %d\n",++kase,m); else if(m==0) printf("Case %d: No answer!\n",++kase); } return 0; }