/*ID: loniskaiLANG: CTASK: ride*/#includemain () { FILE *fin = fopen ("ride.in", "r"); FILE *fout = fopen ("ride.out", "w"); long int a,b,c,d; char s1[7],s2[7]; fscanf (fin, "%s\n%s", &s1, &s2); b=1; for(a=0;(s1[a]!='\0')&&(a<=5);a++) b*=(s1[a]-64); d=1; for(a=0;(s2[a]!='\0')&&(a<=5);a++) d*=(s2[a]-64); c=0; if ((b%47)==(d%47)) c=1; if (c==1) fprintf (fout,"GO\n"); else fprintf (fout,"STAY\n"); exit (0); }
posted on 2012-07-27 01:55 阅读( ...) 评论( ...)