CSU 1330 字符識別? 【找規律】
阿新 • • 發佈:2017-08-18
lap str sca blog int fin spl clas span
你的任務是寫一個程序進行字符識別。別擔心,你只需要識別1, 2, 3,如下:
.*. *** ***
.*. ..* ..*
.*. *** ***
.*. *.. ..*
.*. *** ***
Input
輸入僅包含一組數據,由6行組成。第一行為字符的個數n(1<=n<=10)。以下5行每行包含4n個字符。每個字符恰好占5行3列,然後是一個空列(用"."填充)。
Output
輸出應包含一行,即識別出的各個字符。
Sample Input
3 .*..***.***. .*....*...*. .*..***.***. .*..*.....*. .*..***.***.
Sample Output
123
#include<cstdio> #include<cstring> #include<algorithm> #include<iostream> #include<string> #include<vector> #include<stack> #include<bitset> #include<cstdlib> #include<cmath> #include<set> #include字符串處理<list> #include<deque> #include<map> #include<queue> #define INF 999999 using namespace std; char a[105][1005]; int main() { int n; scanf("%d",&n); for(int i=0;i<5;++i) scanf("%s",a[i]); for(int i=0;i<n*4;i+=4) { if(a[3][i+1]==‘*‘) printf("1"); else if(a[3][i]==‘*‘) printf("2"); else printf("3"); } return 0; }
CSU 1330 字符識別? 【找規律】