QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#348189#7933. Build PermutationZhaoZiLongCompile Error//C89993b2024-03-09 17:24:102024-03-09 17:24:12

Details

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