Uva - 10878 - Decode the tape
来源:互联网 发布:网络电视iptv设置 编辑:程序博客网 时间:2024/05/10 15:25
题意:给出一个图,从中译码。
题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&category=&problem=1819
——>>‘o’为1,空格为0,‘.’不理,构成一个七位的二进制数,对应的ASCII码的字符即是答案。
#include <iostream>using namespace std;int main(){ char s[15]; while(cin.getline(s, sizeof(s))) { if(s[0] == '|') { char c = 0; for(int i = 2; i <= 5; i++) if(s[i] == 'o') c = c * 2 + 1; else c *= 2; for(int i = 7; i <= 9; i++) if(s[i] == 'o') c = c * 2 + 1; else c *= 2; cout<<c; } } return 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
- javascript 中的null 和undefined
- I3的 2120cpu(盒)自带散热器吗?组装主机还要再配散热器吗
- 新手任务
- Visual C#——获取当前时间表
- [Leetcode] Distinct Subsequences
- Uva - 10878 - Decode the tape
- UVA 10935 - Throwing cards away I
- soj - 1701 - Cannonball Pyramids
- Eclipse for C/C++ 安装插件另类的方式
- UVA 514 - Rails
- 程序在他人电脑上报缺失msvcr100d.dll 处理
- leetcode Convert Sorted List to Binary Search Tree
- 【Visual C++】游戏开发笔记四十六 浅墨DirectX教程十四 模板测试与镜面特效专场
- [Leetcode] Interleaving String