全WA了(悲)

P5730 【深基5.例10】显示屏

Tangent233 @ 2020-04-18 10:42:00

#include<bits/stdc++.h>
using namespace std;
char a[10][5][3]={{{'x','x','x'},{'x','.','x'},{'x','.','x'},{'x','.','x'},{'x','x','x'}},//0
                   {{'.','.','x'},{'.','.','x'},{'.','.','x'},{'.','.','x'},{'.','.','x'}},//1
                   {{'x','x','x'},{'.','.','x'},{'x','x','x'},{'x','.','.'},{'x','x','x'}},//2
                   {{'x','x','x'},{'.','.','x'},{'x','x','x'},{'.','.','.'},{'x','x','x'}},//3
                   {{'x','.','x'},{'x','.','x'},{'x','x','x'},{'.','.','x'},{'.','.','x'}},//4
                   {{'x','x','x'},{'x','.','.'},{'x','x','x'},{'.','.','x'},{'x','x','x'}},//5
                   {{'x','x','x'},{'x','.','.'},{'x','x','x'},{'x','.','x'},{'x','x','x'}},//6
                   {{'x','x','x'},{'.','.','x'},{'.','.','x'},{'.','.','x'},{'.','.','x'}},//7
                   {{'x','x','x'},{'x','.','x'},{'x','x','x'},{'x','.','x'},{'x','x','x'}},//8
                   {{'x','x','x'},{'x','.','x'},{'x','x','x'},{'.','.','x'},{'x','x','x'}}};//9
int p[101];
int main()
{
    //freopen("sb.in","r",stdin);
    //freopen("sb.out","w",stdout);
    int k;
    scanf("%d",&k);
    getchar();
    char c;
    for(int i=1;i<=k;i++)
    {
        scanf("%c",&c);
        p[i]=c-'0';
    }
//  for(int i=1;i<=k;i++)
//  {
//      cout<<p[i];
//  }
    for(int l=0;l<=4;l++)
    {
        for(int i=1;i<=k;i++)
        {
            for(int i1=0;i1<3;i1++)
            {
                putchar(a[p[i]][l][i1]);
            }
            if(i!=k)putchar('.');
        }
        putchar('\n');
    }
    return 0;
}

怎么会输出ASCII0啊,这个错误蒟蒻不会查


by 一只爪巴行者 @ 2020-04-18 11:01:47

@Lovely_Chtholly 啊是搞反了,而且\r\n也搞反了……


by 一只爪巴行者 @ 2020-04-18 11:02:21

我自裁我没脸了(悲)


by Tangent233 @ 2020-04-18 11:07:12

感谢大佬们


上一页 |