求助!
查看原帖
求助!
901195
__Luna__楼主2022/12/31 20:23

谁帮我看看……
测试了一堆数据,都是对的。但提交就全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;
}
2022/12/31 20:23
加载中...