90分求助

P1200 [USACO1.1] 你的飞碟在这儿 Your Ride Is Here

一边计算一边做% ```cpp #include<iostream> #include<cmath> #include<cstdio> #include<cstring> using namespace std; int main(){ char hx[10]={},xz[10]={}; int k=1,j=1; //puts(hx); gets(hx); gets(xz); for(int i=0;i<6;i++){ if(hx[i]!='\0')k=k*(hx[i]-64)%47; //cout<<k<<endl; if(xz[i]!='\0')j=j*(xz[i]-64)%47; //cout<<j<<endl; } k%=47; j%=47; if(k==j)cout<<"GO"; if(k!=j)cout<<"STAY"; return 0; } ```
by SofanHe @ 2017-09-18 18:19:11


|