Decode the tape
来源:互联网 发布:淘宝怎么开好店 编辑:程序博客网 时间:2024/04/28 18:22
#include <string.h>
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <map>
using namespace std;
char s[20];
string str;
int num[] = {0, 128, 64, 32, 16, 8, 0, 4, 2, 1};
int main()
{
bool flag = false;
char head[] = "___________";
while(gets(s))
{
if(!flag && !strcmp(s,head))
{
flag = true;
str.clear();
continue;
}
if(flag && !strcmp(s, head))
{
cout<<str;
flag = false;
break;
}
int sum = 0;
for( int i = 1; i <= 9; i++)
if(s[i] == 'o')
sum += num[i];
str += char(sum);
}
return 0;
}
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <map>
using namespace std;
char s[20];
string str;
int num[] = {0, 128, 64, 32, 16, 8, 0, 4, 2, 1};
int main()
{
bool flag = false;
char head[] = "___________";
while(gets(s))
{
if(!flag && !strcmp(s,head))
{
flag = true;
str.clear();
continue;
}
if(flag && !strcmp(s, head))
{
cout<<str;
flag = false;
break;
}
int sum = 0;
for( int i = 1; i <= 9; i++)
if(s[i] == 'o')
sum += num[i];
str += char(sum);
}
return 0;
}
0 0
- 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
- 10878 - Decode the tape
- 请求json开辟多线程,针对加载图片数据开辟多线程
- 浏览器内部工作原理
- request.getSession().setAttribute("",..)和request.setAttribute("",...)的区别
- 644
- SSH项目的菜单问题及解决方法
- Decode the tape
- 查看sqlserver被锁的表以及如何解锁
- C语言运算符优先级 详细列表
- Galera/mysql 集群
- UVA 409
- ffmpeg+sdl教程----------编写一个简单的播放器1
- JD 1421:Abor(概率统计)
- android framework中调用第三方的jar包
- Alpha-Beta搜索