QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#352105#7933. Build PermutationZhangYiDeCompile Error//C891.2kb2024-03-12 20:56:132024-03-12 20:56:13

Details

answer.code: In function ‘pailie’:
answer.code:11:4: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
   11 |    for(int i=0;i<n;i++)
      |    ^~~
answer.code:11:4: note: use option ‘-std=c99’, ‘-std=gnu99’, ‘-std=c11’ or ‘-std=gnu11’ to compile your code
answer.code:17:4: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
   17 |    for (int gap = n / 2; gap > 0; gap /= 2) {
      |    ^~~
answer.code:18:7: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
   18 |       for (int i = gap; i < n; i++) {
      |       ^~~
answer.code:31:12: error: redefinition of ‘i’
   31 |    for(int i=0;i<n;i++)
      |            ^
answer.code:11:12: note: previous definition of ‘i’ was here
   11 |    for(int i=0;i<n;i++)
      |            ^
answer.code:31:4: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
   31 |    for(int i=0;i<n;i++)
      |    ^~~
answer.code: In function ‘main’:
answer.code:44:5: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
   44 |     for (int i = 0; i < n; i++)
      |     ^~~
answer.code:54:7: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
   54 |       for (int i = 0; i < n; i++)
      |       ^~~
answer.code:42:5: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
   42 |     scanf("%d",&n);
      |     ^~~~~~~~~~~~~~
answer.code:46:7: warning: ignoring return value of ‘scanf’, declared with attribute warn_unused_result [-Wunused-result]
   46 |       scanf("%d",&a[i].letter);
      |       ^~~~~~~~~~~~~~~~~~~~~~~~