救命

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

你是不是对```cin ```和```scanf```有什么偏见,为啥要用```gets``` :( ```cpp #include<bits/stdc++.h> using namespace std; char a[7],b[7]; long long cnt_a,cnt_b,sum_a=1,sum_b=1; int main(){ cin>>a>>b; cnt_a=strlen(a);cnt_b=strlen(b); for(int i=0;i<cnt_a;i++){ sum_a=sum_a*(a[i]-'A'+1); } for(int i=0;i<cnt_b;i++){ sum_b=sum_b*(b[i]-'A'+1); } if((sum_a%47)==(sum_b%47)){ cout<<"GO"<<endl; }else{ cout<<"STAY"<<endl; } return 0; } ```
by not_much @ 2024-03-18 18:11:49


|