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

TOP

返回列表