What is the character recognition in the ninth Hunan University Computer Programming Competition?

Source: Internet
Author: User

Character Recognition? Time Limit: 1 sec memory limit: 128 MB
Submit: 156 solved: 98
[Submit] [Status] [web board] Description

Your task is to write a program for character recognition. Don't worry, you only need to identify 1, 2, 3, as follows:

 

.*.******

.*...*..*

.*.******

.*.*....*

.*.******

Input

The input contains only one group of data, which consists of six rows. The first row contains N (1 <=n <= 10) characters ). Each row of the following five rows contains 4 n characters. Each character exactly occupies five rows and three columns, followed by an empty column (filled ).

Output

The output should contain one line, that is, each character recognized.

Sample Input
3.*..***.***..*....*...*..*..***.***..*..*.....*..*..***.***.
Sample output
123
Hintsource

Hunan ninth College Computer Program Design Competition


The key to this question is to find the difference between the fourth line ......




The AC code is as follows:


#include<iostream>#include<cstring>using namespace std;int main(){    int n;    int i,j;    char a[5][100];    cin>>n;    for(i=0;i<5;i++)    cin>>a[i];    int l=strlen(a[0]);    int bj=0;    for(i=0;i<l;i++)    {        bj++;        if(bj==1&&a[3][i]=='*')            cout<<"2";        if(bj==2&&a[3][i]=='*')            cout<<"1";        if(bj==3&&a[3][i]=='*')            cout<<"3";        if(bj==4)            bj=0;    }    cout<<endl;    return 0;}




Related Article

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.