返回列表 發帖
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main(){
  4. for(int t=0;t<3;t++)
  5. {
  6.   string str;
  7.   int n[5];
  8.   getline(cin,str);
  9. for(int i=0;i<5;i++)
  10.   n[i]=str[i]-'0';
  11.   int res=(n[0]+n[2]+n[4]+(n[1]+n[3])*5)%26;
  12. if(res==str[5]-'A'+1)
  13.   cout<<"Pass"<<endl;
  14. else
  15.   cout<<"Fail"<<endl;
  16. }
  17. return 0;
  18. }
複製代碼

TOP

返回列表