C语言,第12个错了,请问为什么?
查看原帖
C语言,第12个错了,请问为什么?
1258187
wanXuaYu123楼主2024/1/18 18:40

错误原因:Wrong Answer.wrong answer Too long on line 1.

#include<stdio.h>
int main(){
    int a1,a2,b1,b2,c1,c2,d1,d2,e1,e2,f1,f2,g1,g2;
    int a3,b3,c3,d3,e3,f3,g3;
    scanf("%d %d",&a1,&a2);
    scanf("%d %d",&b1,&b2);
    scanf("%d %d",&c1,&c2);
    scanf("%d %d",&d1,&d2);
    scanf("%d %d",&e1,&e2);
    scanf("%d %d",&f1,&f2);
    scanf("%d %d",&g1,&g2);
    a3=a1+a2;
    b3=b1+b2;
    c3=c1+c2;
    d3=d1+d2;
    e3=e1+e2;
    f3=f1+f2;
    g3=g1+g2;
    if(a3<9&&b3<9&&c3<9&&d3<9&&e3<9&&f3<9&&g3<9){
        printf("0");
    }
    int temp;
    temp=a3>b3?a3:b3;
    temp=temp>c3?temp:c3;
    temp=temp>d3?temp:d3;
    temp=temp>e3?temp:e3;
    temp=temp>f3?temp:f3;
    temp=temp>g3?temp:g3;
    if(temp==a3){
        printf("1");
    }else if(temp==b3){
        printf("2");
    }else if(temp==c3){
        printf("3");
    }else if(temp==d3){
        printf("4");
    }else if(temp==e3){
        printf("5");
    }else if(temp==f3){
        printf("6");
    }else if(temp==g3){
        printf("7");
    }
    return 0;
}
2024/1/18 18:40
加载中...