原题链接:
https://vjudge.net/problem/UVA-10878
AC代码:
#include <bits/stdc++.h>
using namespace std;
int c[11] = {0, 0, 64, 32, 16, 8, 0, 4, 2, 1,0};
int main()
{
char str[20];
fgets(str, 21, stdin);
while(fgets(str, 21, stdin)&&str[0]!='-'){
int ans=0;
for (int i = 2; i < strlen(str);i++){
if(str[i]=='o'){
ans += c[i];
}
}
cout << char(ans);
}
return 0;
}
淦!这题好**怪