UVa 10878 Decode The tape: interesting questions

Source: Internet
Author: User
Tags time limit

10878-decode the tape

Time limit:3.000 seconds

Http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=96&page=show_problem &problem=1819

"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. It falls to the figure out what are written on them.

Input the input would contain one tape.

Output output The message this is written on the tape.

___________
| 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 | |
o| |
oo o.o o|  |-ooo oo| | o  .   |
| oo o.ooo|
| ooo oo |
| oo  . o o| |
ooo o  | | o  .   |
| | ooo. 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 |
___________

Look at the tapes more.

Complete code:

#include <cstdio>  
#include <cstdlib>  
    
char str[11], num[8], *endstr;  
    
int main (void)  
{  
    gets (str);  
    while (gets (str), str[1]!= ' _ ')  
    {  
        int i;  
        for (i = 2; I <= 5; ++i)  
            num[i-2] = (str[i] = = ' o '? ' 1 ': ' 0 ');  
        for (i = 7; I <= 9; ++i)  
            num[i-3] = (str[i] = = ' o '? ' 1 ': ' 0 ');  
        NUM[7] = ' the ';  
        Putchar (Strtol (num, &ENDSTR, 2));  
    return 0;  
}

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/sjjg/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.