Submission #16307

# Submission time Handle Problem Language Result Execution time Memory
16307 2015-08-20T11:03:33 Z who7117 꼬마 정민 (kriii3_RR) C++
Compilation error
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]);
                                               ^