You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
2.6 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#include <bits/stdc++.h>
using namespace std;
char W[10][5][3] = { //10个数字每个数字5行3列
{//0
'X', 'X', 'X',
'X', '.', 'X',
'X', '.', 'X',
'X', '.', 'X',
'X', 'X', 'X',
},
{//1
'.', '.', 'X',
'.', '.', 'X',
'.', '.', 'X',
'.', '.', 'X',
'.', '.', 'X',
},
{//2
'X', 'X', 'X',
'.', '.', 'X',
'X', 'X', 'X',
'X', '.', '.',
'X', 'X', 'X',
},
{//3
'X', 'X', 'X',
'.', '.', 'X',
'X', 'X', 'X',
'.', '.', 'X',
'X', 'X', 'X',
},
{//4
'X', '.', 'X',
'X', '.', 'X',
'X', 'X', 'X',
'.', '.', 'X',
'.', '.', 'X',
},
{//5
'X', 'X', 'X',
'X', '.', '.',
'X', 'X', 'X',
'.', '.', 'X',
'X', 'X', 'X',
},
{//6
'X', 'X', 'X',
'X', '.', '.',
'X', 'X', 'X',
'X', '.', 'X',
'X', 'X', 'X',
},
{//7
'X', 'X', 'X',
'.', '.', 'X',
'.', '.', 'X',
'.', '.', 'X',
'.', '.', 'X',
},
{//8
'X', 'X', 'X',
'X', '.', 'X',
'X', 'X', 'X',
'X', '.', 'X',
'X', 'X', 'X',
},
{//9
'X', 'X', 'X',
'X', '.', 'X',
'X', 'X', 'X',
'.', '.', 'X',
'X', 'X', 'X',
}
};
int n;
char s[110];
int main() {
cin >> n;
for (int i = 0; i < n; i++)
cin >> s[i];
//因为C++的输出是按行输出的,所以要用一些技巧
//1、枚举每一行
for (int i = 0; i < 5; i++) {
//2、枚举每一个数字
for (int j = 0; j < n; j++) {
for (int k = 0; k < 3; k++) //枚举每个数字的列
cout << W[s[j] - '0'][i][k];//输出因为s[j]为字符,所以要减去'0'
//如果最后一列,就不需要打印'.'
if (j != n - 1) cout << '.';
}
cout << endl;
}
return 0;
}