/ SeriousOJ /

Record Detail

Compile Error

foo.c: In function 'main':
foo.c:29:23: error: expected ';' before '{' token
   29 |         else(t1 == t2){
      |                       ^
      |                       ;

Code

#include <stdio.h>

int main()
{
    int a, b, x, t1, t2;
    scanf("%d %d %d", &x, &a, &b);

    if(a>= -1000 && b>= -1000 && x>= -1000 && a<=1000 && b<=1000 && x<=1000){
        if(x<0){
            x = -1*x;
        }

        t1 = x-a;
        t2 = x-b;

        if(t1<0){
            t1 = -1*t1;
        }
        if(t2<0){
            t2 = -1*t2;
        }
        
        if(t1<t2){
            printf("7vai\n");
        }
        else if(t2<t1){
            printf("3vai\n");
        }
        else(t1 == t2){
            printf("mojo\n");
        }

    }

    else{
        return 0;
    }

    return 0;

}

Information

Submit By
Type
Submission
Problem
P1179 7vai , 3vai or mojo ?
Contest
Intra LU IEEE Beginner Programming Contest
Language
C99 (GCC 13.2.0)
Submit At
2025-02-26 07:28:13
Judged At
2025-02-26 07:28:13
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes