답안 #16355

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
16355 2015-08-21T14:22:13 Z eaststar scanf 함수 5 (BSC_0_7) C
컴파일 오류
0 ms 0 KB
main(){int a,b;scanf("%d%d",&a,&b);printf("%g",double(a+b)/2);}

Compilation message

scanf5.c:1:1: warning: return type defaults to ‘int’ [-Wreturn-type]
 main(){int a,b;scanf("%d%d",&a,&b);printf("%g",double(a+b)/2);}
 ^
scanf5.c: In function ‘main’:
scanf5.c:1:1: warning: implicit declaration of function ‘scanf’ [-Wimplicit-function-declaration]
scanf5.c:1:16: warning: incompatible implicit declaration of built-in function ‘scanf’
 main(){int a,b;scanf("%d%d",&a,&b);printf("%g",double(a+b)/2);}
                ^
scanf5.c:1:1: warning: implicit declaration of function ‘printf’ [-Wimplicit-function-declaration]
 main(){int a,b;scanf("%d%d",&a,&b);printf("%g",double(a+b)/2);}
 ^
scanf5.c:1:36: warning: incompatible implicit declaration of built-in function ‘printf’
 main(){int a,b;scanf("%d%d",&a,&b);printf("%g",double(a+b)/2);}
                                    ^
scanf5.c:1:48: error: expected expression before ‘double’
 main(){int a,b;scanf("%d%d",&a,&b);printf("%g",double(a+b)/2);}
                                                ^
scanf5.c:1:48: warning: control reaches end of non-void function [-Wreturn-type]
 main(){int a,b;scanf("%d%d",&a,&b);printf("%g",double(a+b)/2);}
                                                ^