답안 #16354

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

Compilation message

scanf5.cpp:1:6: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
 main(){int a,b;scanf("%d%d",&a,&b);printf("%g",double(a+b)/2);}
      ^
scanf5.cpp: In function ‘int main()’:
scanf5.cpp:1:34: error: ‘scanf’ was not declared in this scope
 main(){int a,b;scanf("%d%d",&a,&b);printf("%g",double(a+b)/2);}
                                  ^
scanf5.cpp:1:61: error: ‘printf’ was not declared in this scope
 main(){int a,b;scanf("%d%d",&a,&b);printf("%g",double(a+b)/2);}
                                                             ^