返回列表 發帖
  1. #include<bits/stdc++.h>
  2. using namespace std;

  3. int main(){
  4.     for(int t=0;t<3;t++){
  5.         string str;
  6.         int n[5];
  7.         getline(cin,str);
  8.         for(int i=0;i<5;i++)
  9.             n[i]=str[i];
  10.         int res=((n[0]+n[2]+n[4])+(n[1]+n[3])*5)%26;
  11.         if(res==str[5]-'A'+1)
  12.             cout<<"Pass"<<endl;
  13.         else
  14.             cout<<"Fail"<<endl;
  15.     }
  16.     return 0;
  17. }
複製代碼

TOP

返回列表