Submission #16307

#TimeUsernameProblemLanguageResultExecution timeMemory
16307who7117꼬마 정민 (kriii3_RR)C++98
Compilation error
0 ms0 KiB
#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 (stderr)

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]);
                                               ^