救救孩子,疯狂WA

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

sunshine_like_you @ 2020-08-05 11:26:40

#include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
char a[101];//存储数串 
int main(){
    int n;
    scanf("%d",&n);
    cin>>a;
    for(int i=1;i<=5;i++){//代表列的序号 
        for(int j=0;j<n;j++){//代表行的序号 
            switch(a[j]-48){
                case 0:{
                    switch(i){
                        case 1: printf("xxx"); break;
                        case 2: printf("x.x"); break;
                        case 3: printf("x.x"); break;
                        case 4: printf("x.x"); break;
                        case 5: printf("xxx"); break;
                    }
                    break;
                }
                case 1:{
                    switch(i){
                        case 1: printf("..x"); break;
                        case 2: printf("..x"); break;
                        case 3: printf("..x"); break;
                        case 4: printf("..x"); break;
                        case 5: printf("..x"); break;
                    }
                    break;
                }
                case 2:{
                    switch(i){
                        case 1: printf("xxx"); break;
                        case 2: printf("..x"); break;
                        case 3: printf("xxx"); break;
                        case 4: printf("x.."); break;
                        case 5: printf("xxx"); break;
                    }
                    break;
                }
                case 3:{
                    switch(i){
                        case 1: printf("xxx"); break;
                        case 2: printf("..x"); break;
                        case 3: printf("xxx"); break;
                        case 4: printf("..x"); break;
                        case 5: printf("xxx"); break;
                    }
                    break;
                }
                case 4:{
                    switch(i){
                        case 1: printf("x.x"); break;
                        case 2: printf("x.x"); break;
                        case 3: printf("xxx"); break;
                        case 4: printf("..x"); break;
                        case 5: printf("..x"); break;
                    }
                    break;
                }
                case 5:{
                    switch(i){
                        case 1: printf("xxx"); break;
                        case 2: printf("x.."); break;
                        case 3: printf("xxx"); break;
                        case 4: printf("..x"); break;
                        case 5: printf("xxx"); break;
                    }
                    break;
                }
                case 6:{
                    switch(i){
                        case 1: printf("xxx"); break;
                        case 2: printf("x.."); break;
                        case 3: printf("xxx"); break;
                        case 4: printf("x.x"); break;
                        case 5: printf("xxx"); break;
                    }
                    break;
                }
                case 7:{
                    switch(i){
                        case 1: printf("xxx");; break;
                        case 2: printf("..x");; break;
                        case 3: printf("..x"); break;
                        case 4: printf("..x"); break;
                        case 5: printf("..x"); break;
                    }
                    break;
                }
                case 8:{
                    switch(i){
                        case 1: printf("xxx"); break;
                        case 2: printf("x.x"); break;
                        case 3: printf("xxx"); break;
                        case 4: printf("x.x"); break;
                        case 5: printf("xxx"); break;
                    }
                    break;
                }
                case 9:{
                    switch(i){
                        case 1: printf("xxx"); break;
                        case 2: printf("x.x"); break;
                        case 3: printf("xxx"); break;
                        case 4: printf("..x"); break;
                        case 5: printf("xxx"); break;
                    }
                    break;
                }
            }
            if(j+1<n) printf(".");
        }
        printf("\n");
    }
    return 0;
} 

by flame_soul @ 2020-08-05 11:36:52

"X"好像是大写的


by tangrunxi @ 2020-08-05 11:37:16

@sunshine_like_you 错因显然,是大写X不是小写x


by Eason_AC @ 2020-08-05 11:38:55

@sunshine_like_you X要大写

我本来还想帮您对拍的


by 郑某人 @ 2020-08-05 11:44:11

论大写的重要性

应该是大小写问题


by Reobrok_Kk @ 2020-08-05 12:42:34

@sunshine_like_you X是大写的

论审清题目的重要性


by sunshine_like_you @ 2020-08-05 19:24:57

我我我QAQ


|