全WA这是为什么,求大佬捞捞

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

yunyi1129 @ 2024-01-13 20:00:47

include <stdio.h>

include <math.h>

int main() { int i, j, k; int n; scanf("%d", &n); getchar();

char a[100];
i = 0;
while((a[i]=getchar())!='\n'){
    i++;
}
a[i] = '\0';

for(i=0;i<n;i++){
    if(i==0){
        if(a[i]=='0'||a[i]=='2'||a[i]=='3'||(a[i]>='5'&&a[i]<='9')){
            printf("XXX");
        }else if(a[i]=='1'){
            printf("..X");
        }else{
            printf("X.X");
        }
    }else{
        printf(".");
        if(a[i]=='0'||a[i]=='2'||a[i]=='3'||(a[i]>='5'&&a[i]<='9')){
            printf("XXX");
        }else if(a[i]=='1'){
            printf("..X");
        }else{
            printf("X.X");
        }
    }
}
printf("\n");

for(i=0;i<n;i++){
    if(i==0){
        if(a[i]=='0'||a[i]=='4'||(a[i]>='8'&&a[i]<='9')){
            printf("X.X");
        }else if(a[i]=='1'){
            printf("..X");
        }else if(a[i]=='5'||a[i]=='6'){
            printf("X..");
        }else{
            printf("..X");
        }
    }else{
        printf(".");
        if(a[i]=='0'||a[i]=='4'||(a[i]>='8'&&a[i]<='9')){
            printf("X.X");
        }else if(a[i]=='1'){
            printf("..X");
        }else if(a[i]=='5'||a[i]=='6'){
            printf("X..");
        }else{
            printf("..X");
        }
    }
}
printf("\n");

for(i=0;i<n;i++){
    if(i==0){
        if(a[i]=='8'||a[i]=='9'||(a[i]>='2'&&a[i]<='6')){
            printf("XXX");
        }else if(a[i]=='1'){
            printf("..X");
        }else if(a[i]=='0'){
            printf("X.X");
        }else{
            printf("..X");
        }
    }else{
        printf(".");
        if(a[i]=='8'||a[i]=='9'||(a[i]>='2'&&a[i]<='6')){
            printf("XXX");
        }else if(a[i]=='1'){
            printf("..X");
        }else if(a[i]=='0'){
            printf("X.X");
        }else{
            printf("..X");
        }
    }
}
printf("\n");

for(i=0;i<n;i++){
    if(i==0){
        if(a[i]=='1'||a[i]=='3'||a[i]=='4'||a[i]=='5'||a[i]=='7'||a[i]=='9'){
            printf("..X");
        }else if(a[i]=='0'||a[i]=='6'||a[i]=='8'){
            printf("X.X");
        }else{
            printf("X..");
        }
    }else{
        printf(".");
        if(a[i]=='1'||a[i]=='3'||a[i]=='4'||a[i]=='5'||a[i]=='7'||a[i]=='9'){
            printf("..X");
        }else if(a[i]=='0'||a[i]=='6'||a[i]=='8'){
            printf("X.X");
        }else{
            printf("X..");
        }
    }
}
printf("\n");

for(i=0;i<n;i++){
    if(i==0){
        if(a[i]=='0'||a[i]=='2'||a[i]=='3'||a[i]=='5'||a[i]=='6'||a[i]=='8'||a[i]=='9'){
            printf("XXX");
        }else if(a[i]=='1'||a[i]=='4'||a[i]=='7'){
            printf("..X");
        }
    }else{
        printf(".");
        if(a[i]=='0'||a[i]=='2'||a[i]=='3'||a[i]=='5'||a[i]=='6'||a[i]=='8'||a[i]=='9'){
            printf("XXX");
        }else if(a[i]=='1'||a[i]=='4'||a[i]=='7'){
            printf("..X");
        }
    }
}
printf("\n");   
return 0;

}


by milk2715093695 @ 2024-01-18 20:20:14

https://www.luogu.com.cn/discuss/735482 帖子被顶下去了,看看这个,可能是这个的问题


|