Description
Input
The input will contain one tape.
Output
Output the message that is written on the tape.
Sample Input
___________ | o . o| | o . | | ooo . o| | ooo .o o| | oo o. o| | oo . oo| | oo o. oo| | o . | | oo . o | | ooo . o | | oo o.ooo| | ooo .ooo| | oo o.oo | | o . | | oo .oo | | oo o.ooo| | oooo. | | o . | | oo o. o | | ooo .o o| | oo o.o o| | ooo . | | ooo . oo| | o . | | oo o.ooo| | ooo .oo | | oo .o o| | ooo . o | | o . | | ooo .o | | oo o. | | oo .o o| | o . | | oo o.o | | oo . o| | oooo. o | | oooo. o| | o . | | oo .o | | oo o.ooo| | oo .ooo| | o o.oo | | o. o | ___________
Sample Output
A quick brown fox jumps over the lazy dog.
成神讲完题意没看懂题也A了......
#include<iostream>
#include<algorithm>
#include<string.h>
#include<stdio.h>
#include<stdlib.h>
using namespace std;
int main()
{
char ch;
int a = 0;
int flag = 0;
while((ch = getchar())!=EOF)
{
if(ch == '|')
{
flag++;
if(flag == 2)
{
putchar(a);
a = 0;
flag = 0;
}
}
if(ch == 'o')
{
a = a * 2 + 1;
}
else if(ch == ' ')
{
a = a * 2;
}
}
return 0;
}