__Luna__ @ 2022-12-31 20:23:21
谁帮我看看……
测试了一堆数据,都是对的。但提交就全WA……
#include<iostream>
#include<sstream>
#include<cmath>
#include<algorithm>
#include<map>
using namespace std;
int main()
{
char all[5][10][3] = {'X','X','X','.','.','X','X','X','X','X','X','X','X','.','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','.','X','.','.','X','.','.','X','.','.','X','X','.','X','X','.','.','X','.','.','.','.','X','X','.','X','X','.','X','X','.','X','.','.','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','X','.','.','X','X','X','X','X','X','X','X','.','X','.','.','X','X','.','.','.','.','X','.','.','X','.','.','X','X','.','X','.','.','X','X','.','X','.','.','X','X','X','X','.','.','X','X','X','X','X','X','X','.','.','X','X','X','X','X','X','X','.','.','X','X','X','X','X','X','X'};
int a,*b;
cin >> a;
b = new int[a];
cin.get();
for (int i = 0; i < a; i++)b[i]=cin.get()-'0';
for (int i = 0; i < 5; i++)
{
for (int k = 0; k < a - 1; k++)
{
for (int j = 0; j < 3; j++)
{
cout << all[i][b[k]][j];
}
cout << ".";
}
for (int j = 0; j < 3; j++)
{
cout << all[i][b[a - 1]][j];
}
cout << endl;
}
return 0;
}
by Alber_love_Weinstein @ 2022-12-31 20:27:16
好家伙,改用Py过了是吧
by ttltony @ 2023-01-13 22:29:46
@GodForever 建议不要使用三维数组,多打几个表就行了
这是我的AC代码
#include <iostream>
#include <string>
using namespace std;
string no0[5] = {
"XXX",
"X.X",
"X.X",
"X.X",
"XXX"
}, no1[5] = {
"..X",
"..X",
"..X",
"..X",
"..X",
}, no2[5] = {
"XXX",
"..X",
"XXX",
"X..",
"XXX"
}, no3[5] = {
"XXX",
"..X",
"XXX",
"..X",
"XXX"
}, no4[5] = {
"X.X",
"X.X",
"XXX",
"..X",
"..X"
}, no5[5] = {
"XXX",
"X..",
"XXX",
"..X",
"XXX"
}, no6[5] = {
"XXX",
"X..",
"XXX",
"X.X",
"XXX"
}, no7[5] = {
"XXX",
"..X",
"..X",
"..X",
"..X"
}, no8[5] = {
"XXX",
"X.X",
"XXX",
"X.X",
"XXX"
}, no9[5] = {
"XXX",
"X.X",
"XXX",
"..X",
"XXX"
};
int n;
string a1, ans[5];
int a[101];
void copy(int num) {
for (int i = 0; i <= 4; i ++ ) {
if (num == 0) ans[i] += no0[i];
else if (num == 1) ans[i] += no1[i];
else if (num == 2) ans[i] += no2[i];
else if (num == 3) ans[i] += no3[i];
else if (num == 4) ans[i] += no4[i];
else if (num == 5) ans[i] += no5[i];
else if (num == 6) ans[i] += no6[i];
else if (num == 7) ans[i] += no7[i];
else if (num == 8) ans[i] += no8[i];
else if (num == 9) ans[i] += no9[i];
}
}
int main() {
cin >> n;
cin >> a1;
int len = a1.length();
for (int i = 0; i < n; i ++ ) a[i + 1] = a1[i] - '0';
for (int i = 1; i <= n; i ++ ) {
copy(a[i]);
if (i != n) for (int j = 0; j <= 4; j ++ ) ans[j] += '.';
}
for (int i = 0; i <= 4; i ++ ) cout << ans[i] << endl;
return 0;
}
可以看到,我是打表的人,不是打表的神
by kuikuidadi @ 2023-01-18 21:09:03
无语