QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#653120#7941. JackpotGuanYunchangCompile Error//C89641b2024-10-18 19:34:552024-10-18 19:34:56

Details

answer.code: In function ‘main’:
answer.code:16:13: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
   16 |             for (int i = 0; i < 2 * n; i++) {
      |             ^~~
answer.code:16:13: note: use option ‘-std=c99’, ‘-std=gnu99’, ‘-std=c11’ or ‘-std=gnu11’ to compile your code
answer.code:21:22: error: redefinition of ‘i’
   21 |             for (int i = 0; i < n; i++)
      |                      ^
answer.code:16:22: note: previous definition of ‘i’ was here
   16 |             for (int i = 0; i < 2 * n; i++) {
      |                      ^
answer.code:21:13: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
   21 |             for (int i = 0; i < n; i++)
      |             ^~~
answer.code:10:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
   10 |     scanf("%d", &t);
      |     ^~~~~~~~~~~~~~~
answer.code:14:13: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
   14 |             scanf("%d", &n);
      |             ^~~~~~~~~~~~~~~
answer.code:17:13: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
   17 |             scanf("%d", &a[i]);
      |             ^~~~~~~~~~~~~~~~~~