답안 #16307

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
16307 2015-08-20T11:03:33 Z who7117 꼬마 정민 (kriii3_RR) C++
컴파일 오류
0 ms 0 KB
#include<stdio.h>
#define MAX 3
void main()
{
	unsigned long long arr[MAX];
  
		scanf("%d %d %d", &arr[0], &arr[1], &arr[2]);

	printf("%d\n", arr[0] + arr[1] + arr[2]);
}

Compilation message

rr.cpp:3:11: error: ‘::main’ must return ‘int’
 void main()
           ^
rr.cpp: In function ‘int main()’:
rr.cpp:7:46: warning: format ‘%d’ expects argument of type ‘int*’, but argument 2 has type ‘long long unsigned int*’ [-Wformat=]
   scanf("%d %d %d", &arr[0], &arr[1], &arr[2]);
                                              ^
rr.cpp:7:46: warning: format ‘%d’ expects argument of type ‘int*’, but argument 3 has type ‘long long unsigned int*’ [-Wformat=]
rr.cpp:7:46: warning: format ‘%d’ expects argument of type ‘int*’, but argument 4 has type ‘long long unsigned int*’ [-Wformat=]
rr.cpp:9:41: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long unsigned int’ [-Wformat=]
  printf("%d\n", arr[0] + arr[1] + arr[2]);
                                         ^
rr.cpp:7:47: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result]
   scanf("%d %d %d", &arr[0], &arr[1], &arr[2]);
                                               ^