QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#345565#7933. Build PermutationZhaoZiLongCompile Error//C89870b2024-03-07 08:41:052024-03-07 08:41:05

Details

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