답안 #13465

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
13465 2015-02-21T03:55:26 Z gs14004 scanf 함수 5 (BSC_0_7) C++14
컴파일 오류
0 ms 0 KB
#include <stdio.h>
  
int main(){
  int t,u;scanf("%d %d",&t,&u);printf("%g",0.5*(a+b));
}

Compilation message

scanf5.cpp: In function ‘int main()’:
scanf5.cpp:4:49: error: ‘a’ was not declared in this scope
   int t,u;scanf("%d %d",&t,&u);printf("%g",0.5*(a+b));
                                                 ^
scanf5.cpp:4:51: error: ‘b’ was not declared in this scope
   int t,u;scanf("%d %d",&t,&u);printf("%g",0.5*(a+b));
                                                   ^
scanf5.cpp:4:31: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   int t,u;scanf("%d %d",&t,&u);printf("%g",0.5*(a+b));
                               ^