UVA 12658 模拟

来源:互联网 发布:淘宝客在哪推广 编辑:程序博客网 时间:2024/06/06 05:13

Write a program that recognizes characters. Don’t worry, because you only need to recognize three
digits: 1, 2 and 3. Here they are:
.*. *** ***
.*. ..* ..*
.*. *** ***
.*. *.. ..*
.*. *** ***
Input
The input contains only one test case, consisting of 6 lines. The first line contains n, the number of
characters to recognize (1 ≤ n ≤ 10). Each of the next 5 lines contains 4n characters. Each character
contains exactly 5 rows and 3 columns of characters followed by an empty column (filled with ‘.’).
Output
The output should contain exactly one line, the recognized digits in one line.
Sample Input
3
.*..***.***.
.*....*...*.
.*..***.***.
.*..*.....*.
.*..***.***.
Sample Output
123


题意:给你一个字符图形,输出阿拉伯数字


题解:模拟就好了


#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>#include<vector>#include<set>#include<string>using namespace std;#define N 1000+5char s[N][N];typedef unsigned long long LL;  int main(){#ifdef CDZSCfreopen("i.txt","r",stdin);#endifint k;while(~scanf("%d",&k)){for(int i=0;i<5;i++){scanf("%s",s[i]);}for(int i=2;i<4*k;i+=4){if(s[3][i]=='.'){if(s[3][i-1]=='.')printf("2");else printf("1");}else{printf("3");}}puts("");}return 0;}


0 0
原创粉丝点击