链接:http://acm.hdu.edu.cn/contests/contest_showproblem.php?pid=1011&cid=762
题意:给定一个X和.组成的图案,输出图案里的数字。
分析:- - 一开始没看懂题目,没发现给的图里就是数字了。。打个0到9的表,直接读完判一下,就水过去了。。
1 #include<iostream> 2 #include<cstdio> 3 #include<cstring> 4 using namespace std; 5 char p[7][25]; 6 char num[10][30]={ 7 ".XX.X..XX..X....X..XX..X.XX.", 8 ".......X...X.......X...X....", 9 ".XX....X...X.XX.X...X....XX.", 10 ".XX....X...X.XX....X...X.XX.", 11 "....X..XX..X.XX....X...X....", 12 ".XX.X...X....XX....X...X.XX.", 13 ".XX.X...X....XX.X..XX..X.XX.", 14 ".XX....X...X.......X...X....", 15 ".XX.X..XX..X.XX.X..XX..X.XX.", 16 ".XX.X..XX..X.XX....X...X.XX." 17 }; 18 int Check(char s[30]){ 19 for(int i=0;i<10;i++){ 20 if(strcmp(s,num[i])==0)return i; 21 } 22 return -1; 23 } 24 int main(){ 25 int kase; 26 char s[40]; 27 int ans[4]; 28 scanf("%d",&kase); 29 while(kase--){ 30 for(int i=0;i<7;i++) 31 scanf("%s",p[i]); 32 s[0]='