//
// Created by Sween'e'y on 2022/8/15.
//
//P1603 斯诺登的密码
#include <iostream>
#include <iostream>
#include <algorithm>
#include <numeric>
#include <vector>
#include <deque>
#include <array>
#include <set>
#include <map>
#include <iomanip>
#include <cmath>
#include <cstdio>
#include <climits>
#include <string>
#include <cstring>
#include <cctype>
#include <cassert>
using namespace std;
const double PI = acos(-1);
struct cmp {
bool operator()(int a, int b) {
return a > b;
}
};
template<class T>
int length(T &array) {
return sizeof(array) / sizeof(array[0]);
}
bool is_prime[100007];
void ai() {
for (int i = 2; i <= 100000; i++) {
is_prime[i] = 1;
}
for (int i = 2; i <= 100000; i++) {
if (is_prime[i]) {
for (int j = 2 * i; j <= 100000; j += i) {
is_prime[j] = 0;
}
}
}
}
int numberInversion(int x) {
int num = 0;
while (x != 0) {
num = num * 10 + x % 10;
x /= 10;
}
return num;
}
double half(double x) {
return x / 2;
}
string half(string s) {
int n = s.length() / 2;
char *str = new char[n];
for (int i = 0; i < n; i++) {
str[i] = s[i];
}
return str;
}
//转换函数
int convert(string s) {
if (s == "one") {
return 1;
} else if (s == "two") {
return 2;
} else if (s == "three") {
return 3;
} else if (s == "four") {
return 4;
} else if (s == "five") {
return 5;
} else if (s == "six") {
return 6;
} else if (s == "seven") {
return 7;
} else if (s == "eight") {
return 8;
} else if (s == " nine") {
return 9;
} else if (s == "ten") {
return 10;
} else if (s == "eleven") {
return 11;
} else if (s == "twelve") {
return 12;
} else if (s == "thirteen") {
return 13;
} else if (s == "fourteen") {
return 14;
} else if (s == "fifteen") {
return 15;
} else if (s == "sixteen") {
return 16;
} else if (s == "seventeen") {
return 17;
} else if (s == "eighteen") {
return 18;
} else if (s == "nineteen") {
return 19;
} else if (s == "twenty") {
return 20;
} else if (s == "a") {
return 1;
} else if (s == "both") {
return 2;
} else if (s == "another") {
return 1;
} else if (s == "first") {
return 1;
} else if (s == "second") {
return 2;
} else if (s == "third") {
return 3;
} else if (s == "zero") {
return 0;
} else {
return 0;
}
}
int main() {
//true
string s[100];
int arr[100] = {0}, flag = 0;
for (int i = 0; i < 7; i++) {
cin >> s[i];
}
// 抛弃.
for (int i = 0; i < 6; i++) {
arr[i] = convert(s[i]);
}
for (int i = 0; i < 6; i++) {
arr[i] = (arr[i] * arr[i]) % 100;
}
sort(arr, arr + 6);
for (int i = 0; i < 6; i++) {
if (arr[i]) {
if (flag) { //后面的不足两位补零,关键点
printf("%02d", arr[i]);
} else {
if (arr[i]) { //第一位数前导不为零
printf("%d", arr[i]);
flag = 1;
}
}
}
}
if (!flag) {
printf("0");
}
return 0;
}
P1603 斯诺登的密码
于 2022-08-15 17:52:10 首次发布