#include<string>
using namespace std;
int main()
{
string str;
int first,sum;
int num[] = {10,11,12,13,14,15,16,17,34,18,19,20,21,22,35,23,24,25,26,27,28,29,32,30,31,33};
while (getline(cin,str))
{
sum = 0;
first = num[str[0] - 'A'];
sum = (first % 10) * 9 + first / 10;
for(int i = 1;i < 9; i++)
{
sum = sum + (str.at(i) - '0') * (9 - i);
}
sum = sum + (str.at(9) - '0');
if (sum % 10 == 0)
{
cout << "CORRECT!!!" <<endl;
}
else
{
cout << "WRONG!!!" <<endl;
}
}
return 0;
}
沒有留言:
張貼留言