UVA 10878 Decode the tape
2013-07-24 23:20
489 查看
UVA 10878 Decode the tape
只要找出规律就很水。。。其实就是ASCALL码。空格代表0,‘o'代表1,的二进制表示的ASCALL码。然后输出就可以了
#include <stdio.h> #include <string.h> char a[105]; int sb[10]; int main() { sb[1] = 128; sb[2] = 64; sb[3] = 32; sb[4] = 16; sb[5] = 8; sb[7] = 4; sb[8] = 2; sb[9] = 1; while (gets(a) != NULL) { if (a[0] == '|') { int num = 0; for (int i = 1; i < strlen(a) - 1; i ++) { if(a[i] == 'o') num += sb[i]; } printf("%c", num); } } return 0; }
相关文章推荐
- UVA10878 - Decode the tape
- UVA10878 - Decode the tape
- UVA 10878 - Decode the tape
- uva 10878 Decode the tape(字符密码推断)
- UVa 10878 Decode the tape
- UVA 10878 Decode the tape
- uva 10878 Decode the tape(字符串处理)
- UVA10878 - 详解Decode the tape
- UVa:10878 - Decode the tape
- uva 10878 - Decode the tape
- UVA 10878 Decode the tape
- uva 10878 Decode the tape
- Decode the tape - UVa 10878 找规律
- UVA 10878 - Decode the tape
- UVa-10878-Decode the tape
- UVA - 10878 Decode the tape
- uva-10878 - Decode the tape
- UVa 10878 - Decode the tape
- UVA-10878 Decode the tape
- UVa-10878-Decode the tape