p1603 斯诺登的密码
题目描述

代码
#include <iostream>
#include <string>
#include<algorithm>
using namespace std;
string str,ma[27]= {"-1","one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten",
"eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen", "nineteen", "twenty",
"a", "both", "another", "first", "second", "third"
};
int w[27]= {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,1,2,1,1,2,3};
int n,a[15],num=0;
int main() {
int fi=0;
for(int i=1; i<=6; i++) {
cin>>str;//输入第i个字符串
for(int j=1; j<=27; j++) {
if(str==ma[j]) {//判断第i个字符串是否为英文数字
num++;//计数
a[num]=(w[j]*w[j])%100;//将英文数字对应阿拉伯数字,平方并取余,存入数组;
if(a[num])//判断是否为零