小白书训练-Decode the tape
来源:互联网 发布:非对称轮廓度u算法 编辑:程序博客网 时间:2024/05/21 21:35
题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1819
题意:纸带打孔来保持二进制数,打孔便是1,否者为0。这个带子用ASCII保存了一个字符串,一个模拟。用数组使劲RE和WA,无语了。还是一个一个读入过掉的。
代码:
#include <iostream>#include <cstdio>using namespace std;int num[] = {1,1 << 1,1 << 2,1 << 3,1 << 4,1 << 5,1 << 6,1 << 7,1 << 8};int main(){ char s; int xb = 8; char ts = 0; while(~(s = getchar())) { if(s == '\n') { if(xb == 0) { cout << ts; xb = 8; } ts = 0; }else { if(s == 'o') { ts |= num[xb - 1]; xb--; }else if(s ==' ') xb--; } } return 0;}
梦续代码:http://www.hypo.xyz
0 0
- 小白书训练-Decode the tape
- 10878 - Decode the tape
- 10878 - Decode the tape
- 10878 - Decode the tape
- 10878 - Decode the tape
- 10878 - Decode the tape
- 10878 - Decode the tape
- 10878 - Decode the tape
- 10878 - Decode the tape
- 10878 - Decode the tape
- 10878 - Decode the tape
- UVa10878 Decode the tape
- 10878 - Decode the tape
- Decode the tape
- Decode the tape
- Decode the tape
- UVa10878 - Decode the tape
- Decode the tape
- outlook 过滤再接着处理如转发,移动到文件夹,删除等
- 生存函数
- iOS中消息的传递机制
- 如何成为优秀的程序员
- MTK6589双卡卡1或是卡2拨出电话
- 小白书训练-Decode the tape
- Android使用WindowManager覆盖状态栏
- vs 重新编译后 调试 源代码与原始版本不一致
- 使用eclipse远程调试weblogic
- NSString 富文本
- VS2010 快捷键 (空格显示 绿点, Tab 显示箭头)
- ME21N/ME22N/ME23N屏幕增强BADI ME_GUI_PO_CUST
- C#使用StackTrace获取方法被谁调用
- tomcat内置数据源(内置了dbcp数据源)