Submission #18473

#TimeUsernameProblemLanguageResultExecution timeMemory
18473jjhstop짝수 정렬 (tutorial3)C++98
Compilation error
0 ms0 KiB
#include "grader.h" void sort_even(int N, int *A) { int minVal; for (int i = 0; i < N - 1; i++) { minVal = i; for (int j = i + 1; j < N; j++) { if (A[j] < minVal) minVal = j; } if (minVal != i) { int temp; temp = A[minVal]; A[minVal] = A[i]; A[i] = temp; } } for(i = 0; i < N; i++) { if(A[i] % 2 == 0) Report(A[i]); } }

Compilation message (stderr)

tutorial3.cpp: In function ‘void sort_even(int, int*)’:
tutorial3.cpp:18:6: error: name lookup of ‘i’ changed for ISO ‘for’ scoping [-fpermissive]
  for(i = 0; i < N; i++) {
      ^
tutorial3.cpp:18:6: note: (if you use ‘-fpermissive’ G++ will accept your code)