UVA - 10878 Decode the tape
来源:互联网 发布:网络侦探龙帝 编辑:程序博客网 时间:2024/06/01 09:32
http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=25148
题意是给你一个打印机,输出打印机要打印的内容。
其实就是一个找规律的题目,注意到'o' 只有7个有效的位置,那么如果'o'表示为1,空格表示为0的话,第一行是1000001 等于65 恰好是’A'的ascii码,所以就是把每一行对应的字符输出即可。
#include <stdio.h>#include <string.h>int c[] = { 0, 0, 64, 32, 16, 8, 0, 4, 2, 1, 0};int main() {char str[15];int value,i;gets(str);while(gets(str) && str[0] != '_'){value = 0;int len = strlen(str);for(i = 2;i < len;i++){if(str[i] == 'o'){value += c[i];}}printf("%c",value);}return 0;}
0 0
- 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
- 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
- uva 10878 decode the tape
- uva - 10878 - Decode the tape
- uva 10878 Decode the tape
- UVA 10878 Decode the tape
- 在阿里巴巴的那些日子
- (002)循环队列的两种C/C++实现
- IOS上路_01-Win7+VMWare9+MacOSX10.8+XCode4.6.3
- UVa 10970 - Big Chocolate
- PostgreSQL 9.4文档 第1章 入门
- UVA - 10878 Decode the tape
- 图_邻接矩阵
- Java基础——常用API
- Eclipse中debug的一些操作
- 杂谈---潜意识
- 学习笔记 简单的位运算
- 点餐系统思路
- memcpy 优化源码
- gdb常用调试命令