제출 #1314891

#제출 시각아이디문제언어결과실행 시간메모리
1314891chengjiezhuoscanf 함수 5 (BSC_0_7)C++20
100 / 100
0 ms332 KiB
#include <cstdio>
int a, b;
int main(){
    scanf("%d%d", &a, &b);
    if ((a + b) % 2 == 0){
        printf("%d\n", (a + b) / 2);
    }
    else{
        printf("%.1lf\n", (a + b) * 0.5);
    }
}

컴파일 시 표준 에러 (stderr) 메시지

scanf5.cpp: In function 'int main()':
scanf5.cpp:4:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    4 |     scanf("%d%d", &a, &b);
      |     ~~~~~^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...