Decode the tape
Time Limit: 1 second
"Machines take me by surprise with great frequency." |
Alan Turing
Your boss has just unearthed a roll of old computer tapes. The tapes have holes in them and might contain some sort of useful information. It falls to you to figure out what is written on them.
Input
The input will contain one tape.
Output
Output the message that is written on the tape.
Sample Input | Sample Output |
___________ | 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 | ___________ | A quick brown fox jumps over the lazy dog. |
Problemsetter: Igor Naverniouk
Special thanks: BSD games ppt.
这是一个解密的问题,每一横行对应的其实是二进制的ASII码值,o表示1, .什么也不表示,其余表示0.
接着把二进制数变成十进制,再输出就可以了!
#include
#include
#include
main()
{
int a[]={0,0,64,32,16,8,0,4,2,1,0};
char str[15];
int value,i;
gets(str);
while(gets(str) && str[0] != '_')
{
value = 0;
for(i=0;i