Compile Error
foo.c: In function 'main': foo.c:16:24: error: 'dis2' undeclared (first use in this function); did you mean 'diss'? 16 | }else if(diss==dis2){ | ^~~~ | diss foo.c:16:24: note: each undeclared identifier is reported only once for each function it appears in foo.c:20:13: error: too few arguments to function 'printf' 20 | printf() | ^~~~~~ In file included from /usr/include/stdio.h:980, from foo.c:1: /usr/include/x86_64-linux-gnu/bits/stdio2.h:84:1: note: declared here 84 | printf (const char *__restrict __fmt, ...) | ^~~~~~ foo.c:20:21: error: expected ';' before '}' token 20 | printf() | ^ | ; 21 | 22 | } | ~
Code
#include<stdio.h>
int main(){
int x, a, b;
scanf("%d %d %d", &x, &a,&b);
int disl= x-a;
int diss= x-b;
if(disl>diss)
{
printf("7vai");
} else if(diss>disl)
{
printf("3vai");
}else if(diss==dis2){
printf("mojo");
}else{
printf()
}
return 0;
}
Information
- Submit By
- Type
- Pretest
- Problem
- P1179 7vai , 3vai or mojo ?
- Language
- C99 (GCC 13.2.0)
- Submit At
- 2025-02-26 07:05:24
- Judged At
- 2025-02-26 07:05:24
- Judged By
- Score
- 0
- Total Time
- 0ms
- Peak Memory
- 0 Bytes