📄 namepk.cpp
字号:
/**********************************************************************
Author: WHU_dzs
Created Time: 2009-2-15 15:32:43
File Name: pro2.cpp
Description:
**********************************************************************/
#include <iostream>
#include <cstring>
using namespace std;
char s1[1010], s2[1010];
int hp1, str1, spd1;
int hp2, str2, spd2;
void calc (char *s, int &hp, int &str, int &spd) {
int len = strlen(s);
hp = 0;
for (int i = 0; i < len; i++)
hp = (hp + (83 - s[i]) * (83 - s[i])) % 97;
hp = 300 - hp;
str = 1;
for (int i = 0; i < len; i++)
str = (str * s[i]) % 79;
str = 22 + str;
spd = 0;
for (int i = 0; i < len - 1; i++)
for (int j = i + 1; j < len; j++)
spd = (spd + s[i] * s[j]) % 11;
}
int main () {
// freopen("namepk.out", "w", stdout);
int ca;
scanf("%d", &ca);
while (ca--) {
scanf ("%s %s", s1, s2);
calc (s1, hp1, str1, spd1);
calc (s2, hp2, str2, spd2);
bool done = false;
int time = 0;
cout<<hp1<<' '<<str1<<' '<<spd1<<endl;
cout<<hp2<<' '<<str2<<' '<<spd2<<endl;
/*while (!done) {
time++;
if (time % (20 - spd1) == 0)
hp2 -= str1;
if (time % (20 - spd2) == 0)
hp1 -= str2;
if (hp1 <= 0 || hp2 <= 0)
done = true;
}
if (hp1 <= 0 && hp2 > 0)
printf ("lose\n");
else if (hp1 > 0 && hp2 <= 0)
printf ("win\n");
else
printf ("tie\n");
}*/
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -