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

  3. int main()
  4. {
  5.     for(int i=0;i<3;i++)
  6.     {
  7.         string str;
  8.         cin>>str;
  9.         int n[5];
  10.         for(int j=0;j<5;j++)
  11.         {
  12.             n[j]=str[j];
  13.         }
  14.         int res=((n[0]+n[2]+n[4])+(n[1]+n[3])*5)%26;
  15.         if(res==str[5]-'A'+1)
  16.         {
  17.             cout<<"Pass"<<'\n';
  18.         }
  19.         else
  20.         {
  21.             cout<<"Fail"<<'\n';
  22.         }
  23.     }

  24.     return 0;
  25. }
複製代碼

TOP

返回列表