Submission #1680254
Source Code Expand
#include <stdio.h> int main(){ int x, i, N; int ans = 0; scanf("%d", &N); for(i = 1; i < N; i++){ x += i * 10000; } ans = x / N; printf("%d\n", ans); return 0; } ans = x / N; printf("%d\n", ans); return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - AtCoder社の給料 |
User | barrel |
Language | C (GCC 5.4.1) |
Score | 0 |
Code Size | 281 Byte |
Status | CE |
Compile Error
./Main.c:21:4: warning: data definition has no type or storage class ans = x / N; ^ ./Main.c:21:4: warning: type defaults to ‘int’ in declaration of ‘ans’ [-Wimplicit-int] ./Main.c:21:10: error: ‘x’ undeclared here (not in a function) ans = x / N; ^ ./Main.c:21:14: error: ‘N’ undeclared here (not in a function) ans = x / N; ^ ./Main.c:23:11: error: expected declaration specifiers or ‘...’ before string constant printf("%d\n", ans); ^ ./Main.c:23:19: error: expected declaration specifiers or ‘...’ before ‘ans’ printf("%d\n", ans); ^ ./Main.c:25:4: error: expected identifier or ‘(’ before ‘return’ return 0; ^ ./Main.c:26:1: error: expected identifier or ‘(’ before ‘}’ token } ^ ./Main.c: In function ‘main’: ./Main.c:8:4: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result] scanf("%d", &N); ^