criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include<algorithm>
#include<stdio.h>
#include<iostream>

int main(){
	int R[100],n;
	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> R[i];
	}
	int min;
	int swap = 0;
	for (int i = 0; i < n; i++){
		min = i;
		for (int j = i; j < n; j++){
			if (R[j] < R[min])
				min = j;
		}
		if (i != min){
			swap(R[i], R[min]);
			swap++;
		}
	}
	for (int i = 0; i < n; i++){
		if (i != 0)
			cout << " ";
		cout << R[i];
	}
	cout << endl;
	cout << swap << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |         cin >> n;
      |         ^~~
      |         std::cin
In file included from a.cc:3:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:20:29: error: 'swap' cannot be used as a function
   20 |                         swap(R[i], R[min]);
      |                         ~~~~^~~~~~~~~~~~~~
a.cc:26:25: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   26 |                         cout << " ";
      |                         ^~~~
      |                         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:27:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   27 |                 cout << R[i];
      |                 ^~~~
      |                 std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:29:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   29 |         cout << endl;
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:29:17: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   29 |         cout << endl;
      |                 ^~~~
      |                 std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include<algorithm>
#include<stdio.h>
#include<iostream>
using namespace std;

int main(){
	int R[100],n;
	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> R[i];
	}
	int min;
	int swap = 0;
	for (int i = 0; i < n; i++){
		min = i;
		for (int j = i; j < n; j++){
			if (R[j] < R[min])
				min = j;
		}
		if (i != min){
			swap(R[i], R[min]);
			swap++;
		}
	}
	for (int i = 0; i < n; i++){
		if (i != 0)
			cout << " ";
		cout << R[i];
	}
	cout << endl;
	cout << swap << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:29: error: 'swap' cannot be used as a function
   21 |                         swap(R[i], R[min]);
      |                         ~~~~^~~~~~~~~~~~~~
Language: C++

int main(){
  int n,i,j,k=0,kaunt=0,minj;//k=hozon
  int A[N];

  scanf("%d",&n);
  for(i =0;i<n;i++)scanf("%d",&A[i]);


  for(i=0;i<n;i++){
    minj = i;
    for(j=i;j<=n-1;j++){
      if(A[j]<A[minj])minj=j;
    }
    k=A[i];
    A[i]=A[minj];
    A[minj]=k;
    kaunt++;
    if(minj==i)kaunt--;
  }

  

  trace(A,n);
  printf("%d\n",kaunt);
  
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:3:9: error: 'N' was not declared in this scope
    3 |   int A[N];
      |         ^
a.cc:5:3: error: 'scanf' was not declared in this scope
    5 |   scanf("%d",&n);
      |   ^~~~~
a.cc:6:32: error: 'A' was not declared in this scope
    6 |   for(i =0;i<n;i++)scanf("%d",&A[i]);
      |                                ^
a.cc:12:10: error: 'A' was not declared in this scope
   12 |       if(A[j]<A[minj])minj=j;
      |          ^
a.cc:14:7: error: 'A' was not declared in this scope
   14 |     k=A[i];
      |       ^
a.cc:23:9: error: 'A' was not declared in this scope
   23 |   trace(A,n);
      |         ^
a.cc:23:3: error: 'trace' was not declared in this scope
   23 |   trace(A,n);
      |   ^~~~~
a.cc:24:3: error: 'printf' was not declared in this scope
   24 |   printf("%d\n",kaunt);
      |   ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int main(){
Language: C++

int selectSort(int A[], int N){
  int i,j,t,sw =0,minj;
  for (i=0;i<N-1;i++){
    minj =i;
    for (j=i; j<N; j++){
      if(A[j]<A[minj]) minj = j;
    }
    t = A[i];A[i]=A[minj];A[minj]=t;
    if(i != minj ) sw++;
    }
  return sw;
}

int main(){
  int A[100],N,i,sw;
  scanf("%d", &N);
  for (i=0; i<N;i++) scanf("%d", &A[i]);

  sw = selectSort(A,N);

  for (i=0; i<N;i++){
    if (i>0) printf(" ");
    printf("%d",A[i]);
  }
  printf("\n");
  printf("%d\n", sw);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:3: error: 'scanf' was not declared in this scope
   16 |   scanf("%d", &N);
      |   ^~~~~
a.cc:22:14: error: 'printf' was not declared in this scope
   22 |     if (i>0) printf(" ");
      |              ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | int selectSort(int A[], int N){
a.cc:23:5: error: 'printf' was not declared in this scope
   23 |     printf("%d",A[i]);
      |     ^~~~~~
a.cc:23:5: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
a.cc:25:3: error: 'printf' was not declared in this scope
   25 |   printf("\n");
      |   ^~~~~~
a.cc:25:3: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
Language: C++

#include <iostream>
using namespace std;

int bubbleSort(int A[],int N) {
	int sw = 0; 
	bool flag = 1;
	while(int i=0; flag; i++) {
		flag = 0;
		for(int j=N-1;j>=i+1;j--) {
			if(A[j]<A[j-1]) {
				swap(A[j],A[j-1]);
				flag = 1;
				sw++;
			}
		}
	}
	return sw;
}

int main(void) {
	int A[100], N, sw;
	cin >> N;
	for(int i=0;i<N; i++) cin >> A[i];
	
	sw = bubbleSort(A,N);
	
	for(int i=0;i<N;i++) {
		if(i) cout << " ";
		cout << A[i];
	}
	cout << endl;
	cout << sw << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int bubbleSort(int*, int)':
a.cc:7:22: error: expected ')' before ';' token
    7 |         while(int i=0; flag; i++) {
      |              ~       ^
      |                      )
a.cc:7:30: error: 'i' was not declared in this scope
    7 |         while(int i=0; flag; i++) {
      |                              ^
Language: C++

#include<iostream>
#include<algorithm>

static const int N = 10000;
using namespace std;
int a[N];

int main() {
  int n;
  cin >> n;
  for (int i =0;i<n;i++){
      cin >> a[i];
  }
  int cnt=0;
  int minj = 0;
  for (int i=0;i<n;i++){
      int minj = i;
      for (int j=i;j<n;j++){
          if (a[j] < a[minj]){
              minj = i;
              
          }
      }
      if (i!=minj) {
          swap(a[i],a[minj]);
          cnt++;
      }
  
  for (int i=0;i<n;i++) {
    if(i == n - 1) {
            cout << a[i] << endl;
    } else {
            cout << a[i] << " ";
    }
    }
  cout << cnt << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:2: error: expected '}' at end of input
   38 | }
      |  ^
a.cc:8:12: note: to match this '{'
    8 | int main() {
      |            ^
Language: C++

#include <stdio.h>
#include <iostream>
#include <utility>
using namespace std;

int sort(int a[], int n);

int main(void)
{	
	int n, a[100];
	cin >> n;
	for (int i = 0; i < n; i++) cin >> a[i];
	
	int num = sort(a, n);
	
	for (int i = 0; i < n; i++) {
		cout << a[i];
		if (i < n - 1) cout << " ";
		else cout << endl;
	}
	cout << num << endl;
	
	return 0;
}

int sort(int a[], int n)
{
	int cnt = 0;
	for (int i = 0; i < n; i++) {
		int minj = i;
		for (int j = i; j < n; j++) {
			if (a[j] < a[minj]) {
				minj = j;
			}
		}
		swap(a[j], a[minj]);
		cnt++;
	}
	
	return cnt;
}

Compiler output:
a.cc: In function 'int sort(int*, int)':
a.cc:36:24: error: 'j' was not declared in this scope
   36 |                 swap(a[j], a[minj]);
      |                        ^
Language: C++

#include<iostream>
using namespace std;

int main(){

  int N;
  cin>>N;

  int A[N];
  for(int i=0;i<N;i++) cin>>A[i];
  int minj;
  int sw=0;
  for(int i=0;i<N;i++){
    minj=i;
   int 6
     temp=A[i];
    for(int j=i;j<N;j++){
      if(A[j]<A[minj]){
      swap(A[minj],A[j]);
     ;}
      if(temp!=A[i]) sw++;
	}
  }

  for(int i=0;i<N;i++){
    if(i)cout<<" ";
    cout<<A[i];}
  cout<<endl;
  cout<<sw<<endl;

  return 0;}
			
	 

Compiler output:
a.cc: In function 'int main()':
a.cc:15:8: error: expected unqualified-id before numeric constant
   15 |    int 6
      |        ^
a.cc:21:10: error: 'temp' was not declared in this scope; did you mean 'tm'?
   21 |       if(temp!=A[i]) sw++;
      |          ^~~~
      |          tm
Language: C++

#include<stdio.h>

int selectionSort(int A[],int N){
int i,j,t,sw=0,minj;
for(i=0;i<N-1;i++){
minj=i;
for(j=i;j<N;j++){
if(A[j]<A[minj]){
minj=j;
}
t=A[i];A[i]=A[minj];A[minj]=t;
if(i!=minj)sw++;
}
return sw;
}

int main(){
int A[100],N,i,sw;
scanf("%d",&N);
for(i=0;i<N;i++) scanf("%d",&A[i]);
sw=selectionSort(A,N);
for(i=0;i<N;i++){
if(i>0) printf(" ");
printf("%d",A[i]);
}
printf("\n");
printf("%d\n",sw);

return 0;
}

Compiler output:
a.cc: In function 'int selectionSort(int*, int)':
a.cc:17:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   17 | int main(){
      |         ^~
a.cc:17:9: note: remove parentheses to default-initialize a variable
   17 | int main(){
      |         ^~
      |         --
a.cc:17:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:17:11: error: a function-definition is not allowed here before '{' token
   17 | int main(){
      |           ^
a.cc:30:2: error: expected '}' at end of input
   30 | }
      |  ^
a.cc:3:33: note: to match this '{'
    3 | int selectionSort(int A[],int N){
      |                                 ^
a.cc:30:2: warning: control reaches end of non-void function [-Wreturn-type]
   30 | }
      |  ^
Language: C++

"""
1 selectionSort(A, N) // N??????????´??????????0-?????????????????????A
2   for i ??? 0 ?????? N-1 ?????§
3     minj = i
4     for j ??? i ?????? N-1 ?????§
5       if A[j] < A[minj]
6         minj = j
7     A[i] ??¨ A[minj] ?????????
"""

def sort(A,N):
    count=0
    for i in range(N-1):
        minj=i
        for j in range(i,N-1):
            if A[j]<A[minj]:
                minj=j
        tmp=A[i]
        A[i]=A[minj]
        A[minj]=tmp
        count+=1
    return count

N=int(input())
A=input().split()
t=sort(A,N)
for i in range(N):
    print(A[i],end=' ')
print('\b\n'+str(t))

Compiler output:
a.cc:1:3: warning: missing terminating " character
    1 | """
      |   ^
a.cc:1:3: error: missing terminating " character
a.cc:3:33: error: extended character § is not valid in an identifier
    3 | 2   for i ??? 0 ?????? N-1 ?????§
      |                                 ^
a.cc:5:35: error: extended character § is not valid in an identifier
    5 | 4     for j ??? i ?????? N-1 ?????§
      |                                   ^
a.cc:9:3: warning: missing terminating " character
    9 | """
      |   ^
a.cc:9:3: error: missing terminating " character
a.cc:29:7: warning: multi-character character constant [-Wmultichar]
   29 | print('\b\n'+str(t))
      |       ^~~~~~
a.cc:1:1: error: expected unqualified-id before string constant
    1 | """
      | ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
 
int main()
{
    int n,ans;
    cin>>n;
     
    vector<int> a(n);
    for(int i=0;i<n;i++) cin>>a[i]; //n?????\???
     
    for(int i=0;i<n;i++){
        int m=i;
        for(int j=i+1;j<n;j++){
            if(a[j]<a[m]) m=j;
        }
        if(m!=i) ans++
        swap(a[m],a[i]);
    }

    for(int i=0;i<n;i++){
        if(i>0) cout<<" ";
        cout<<a[i];
    }
    cout<<endl<<ans; 
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:23: error: expected ';' before 'swap'
   17 |         if(m!=i) ans++
      |                       ^
      |                       ;
   18 |         swap(a[m],a[i]);
      |         ~~~~
Language: C++

#include<iostream>
using namespace std;
int main(){
    int b=0,n,i,minj,swap;
    int a[100];
    cin>>n;
    for(i=0;i<n;i++){
        cin>>a[i];
    }
    if(n>1){
        for(i=0;i<n-1;i++){
          
            minj=i+1;
            for(j=i+1;j<n;j++){
                if(a[minj]>a[j]){
                    
                    minj=j;
                }
            }
            if(a[minj]<a[i]){
                swap=a[i];
                a[i]=a[minj];
                a[minj]=swap;
                b++;
            }
            /*for(int k=0;k<n-1;k++){
                cout<<a[k]<<" "<<flush;
            }
            cout<<a[n-1]<<endl;*/
        }
    }
    else{
        cout<<a[0]<<endl;
        cout<<0<<endl;
        return 0;
    }
    for(i=0;i<n-1;i++){
        cout<<a[i]<<" "<<flush;
    }
    cout<<a[n-1]<<endl;
    cout<<b<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: 'j' was not declared in this scope
   14 |             for(j=i+1;j<n;j++){
      |                 ^
Language: C++

include<iostream>
using namespace std;
int main(){
    int b=0,n,i,minj,j,swap;
    int a[100];
    cin>>n;
    for(i=0;i<n;i++){
        cin>>a[i];
    }
    if(n>1){
        for(i=0;i<n-1;i++){
          
            minj=i+1;
            for(j=i+1;j<n;j++){
                if(a[minj]>a[j]){
                    
                    minj=j;
                }
            }
            if(a[minj]<a[i]){
                swap=a[i];
                a[i]=a[minj];
                a[minj]=swap;
                b++;
            }
            /*for(int k=0;k<n-1;k++){
                cout<<a[k]<<" "<<flush;
            }
            cout<<a[n-1]<<endl;*/
        }
    }
    else{
        cout<<a[0]<<endl;
        cout<<0<<endl;
        return 0;
    }
    for(i=0;i<n-1;i++){
        cout<<a[i]<<" "<<flush;
    }
    cout<<a[n-1]<<endl;
    cout<<b<<endl;
    return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:5: error: 'cin' was not declared in this scope
    6 |     cin>>n;
      |     ^~~
a.cc:33:9: error: 'cout' was not declared in this scope
   33 |         cout<<a[0]<<endl;
      |         ^~~~
a.cc:33:21: error: 'endl' was not declared in this scope
   33 |         cout<<a[0]<<endl;
      |                     ^~~~
a.cc:38:9: error: 'cout' was not declared in this scope
   38 |         cout<<a[i]<<" "<<flush;
      |         ^~~~
a.cc:38:26: error: 'flush' was not declared in this scope
   38 |         cout<<a[i]<<" "<<flush;
      |                          ^~~~~
a.cc:40:5: error: 'cout' was not declared in this scope
   40 |     cout<<a[n-1]<<endl;
      |     ^~~~
a.cc:40:19: error: 'endl' was not declared in this scope
   40 |     cout<<a[n-1]<<endl;
      |                   ^~~~
Language: C++

#include<stdio.h>

int selectionSort(int A[],int N){
  int i,j,t,sw=0,minj;
  for(i=0;i<N-1;i++){
    minj=i;
    for(j=i;j<N;j++){
      if(A[j]<A[minj])minj=j;
    }
    t=A[i];A[i]=A[minj];A[min]=t;
    if(i!=minj)sw++;
  }
  return sw;
}

int main(){
  int A[100],N,i,sw;

  scanf("%d",&N);
  for(i=0;i<N;i++){
    if(i>0)printf(" ");
    printf("%d",A[i]);
  }
  printf("\n");
  printf("%d\n",sw);

  return 0;
}

Compiler output:
a.cc: In function 'int selectionSort(int*, int)':
a.cc:10:27: error: 'min' was not declared in this scope; did you mean 'minj'?
   10 |     t=A[i];A[i]=A[minj];A[min]=t;
      |                           ^~~
      |                           minj
Language: C++

#include<bits/stdc++.h>

int selectionSort(int A[],int N){
  int i,j,t,sw=0,minj;
  for(i=0;i<N-1;i++){
    minj=i;
    for(j=i;j<N;j++){
      if(A[j]<A[minj])minj=j;
    }
    t=A[i];A[i]=A[minj];A[min]=t;
    if(i!=minj)sw++;
  }
  return sw;
}

int main(){
  int A[100],N,i,sw;

  scanf("%d",&N);
  for(i=0;i<N;i++){
    if(i>0)printf(" ");
    printf("%d",A[i]);
  }
  printf("\n");
  printf("%d\n",sw);

  return 0;
}

Compiler output:
a.cc: In function 'int selectionSort(int*, int)':
a.cc:10:27: error: 'min' was not declared in this scope; did you mean 'std::min'?
   10 |     t=A[i];A[i]=A[minj];A[min]=t;
      |                           ^~~
      |                           std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int selectionSort(int A[],int N){
  int i,j,t,sw=0,minj;
  for(i=0;i<N-1;i++){
    minj=i;
    for(j=i;j<N;j++){
      if(A[j]<A[minj])minj=j;
    }
    t=A[i];A[i]=A[minj];A[min]=t;
    if(i!=minj)sw++;
  }
  return sw;
}

int main(){
  int A[100],N,i,sw;

  scanf("%d",&N);
  for(i=0;i<N;i++){
    if(i>0)printf(" ");
    printf("%d",A[i]);
  }
  printf("\n");
  printf("%d\n",sw);

  return 0;
}

Compiler output:
a.cc: In function 'int selectionSort(int*, int)':
a.cc:10:26: error: invalid types 'int*[<unresolved overloaded function type>]' for array subscript
   10 |     t=A[i];A[i]=A[minj];A[min]=t;
      |                          ^
Language: C++

#include<stdio.h>

int selectionSort(int A[],int N){
  int i,j,t,sw=0,minj;
  for(i=0;i<N-1;i++){
    minj=i;
    for(j=i;j<N;j++){
      if(A[j]<A[minj])minj=j;
    }
    t=A[i];A[i]=A[minj];A[minj]=t;
    if(i!=minj)sw++;
  }
  return sw;
}

int main(){
  int A[100],N,i,sw;

  scanf("%d",&N);
  for(i=0;i<N;i++)scanf("%d",&A[i];);

  sw=selectionSort(A,N);

  for(i=0;i<N;i++){
    if(i>0)printf(" ");
    printf("%d",A[i]);
  }
  printf("\n");
  printf("%d\n",sw);

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:35: error: expected ')' before ';' token
   20 |   for(i=0;i<N;i++)scanf("%d",&A[i];);
      |                        ~          ^
      |                                   )
a.cc:20:36: error: expected primary-expression before ')' token
   20 |   for(i=0;i<N;i++)scanf("%d",&A[i];);
      |                                    ^
Language: C++

#include<iostream>
 
using namespace std;

int selectionSort (int A[], int n) {

    int i, j, v, count = 0, minj;

    for (i = 0; i < n) {

        minj = i;

        for (j = i; j < n; j++) {

            if (A[j] < A[minj]) {

                minj = j;

            }

        }

        if (i != minj) {

            v = A[i];
            A[i] = A[minj];
            A[minj] = v;

            count += 1;

        }

    }

    return 0;

}

int main () {
  
    int i, n, count, A[100];
  
    cin >> n;
  
    for (i = 0; i < n; i++) {
  
        cin >> A[i];
  
    }
 
    count = selectionSort (A, n);
 
    for (i = 0; i < n; i++) {
 
        cout << A[i];
 
        if (i < n - 1) {
 
            cout << " ";
 
        }
 
    }
 
    cout << endl;
    cout << count << endl;
 
    return 0;
 
}

Compiler output:
a.cc: In function 'int selectionSort(int*, int)':
a.cc:9:22: error: expected ';' before ')' token
    9 |     for (i = 0; i < n) {
      |                      ^
      |                      ;
Language: C++

int SelectionSort(int a[],int n)
{
	int times=0,minj,j;
	for(int i=0;i<n;i++)
	{
		minj=i;
		for(j=i;j<n;j++)
			if(a[j]<a[minj])
				minj=j;
		if(minj!=i)
		{
			swap(a[minj],a[i]);
			times++;
		}
	}
	return times;
}
int main()
{
    int a[100];
    int n;
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>a[i];
    int times = SelectionSort(a,n);
    for(int i=0;i<n-1;i++)
        cout<<a[i]<<' ';
    cout<<a[n-1]<<endl;
    cout<<times<<endl;
    return 0;
}

Compiler output:
a.cc: In function 'int SelectionSort(int*, int)':
a.cc:12:25: error: 'swap' was not declared in this scope
   12 |                         swap(a[minj],a[i]);
      |                         ^~~~
a.cc: In function 'int main()':
a.cc:22:5: error: 'cin' was not declared in this scope
   22 |     cin>>n;
      |     ^~~
a.cc:27:9: error: 'cout' was not declared in this scope
   27 |         cout<<a[i]<<' ';
      |         ^~~~
a.cc:28:5: error: 'cout' was not declared in this scope
   28 |     cout<<a[n-1]<<endl;
      |     ^~~~
a.cc:28:19: error: 'endl' was not declared in this scope
   28 |     cout<<a[n-1]<<endl;
      |                   ^~~~
Language: C++

#include <stdlib.h>
#include <stdio.h>

int main(){
int m,y,x,n,i,j,k,a[100];
m=0;
scanf("%d,%n);
for(i=0;i<n;i++){
    scanf("%d",&a[i]);
    }
for(i=0;i<n;i++){
    for(j=i;j<n;j++){
       x=a[j];
        for(k=i;k<n;k++){
       if(x>a[k]){
          y=x;
          x=a[k];
       a[k]=y;
           m++;
           }
         }
       }
    }
  for(i=0;i<n-1;i++){
printf("%d ",a[i]);
      }
   printf("%d\n%d\n,a[n-1],m);
 return 0;
}

Compiler output:
a.cc:7:7: warning: missing terminating " character
    7 | scanf("%d,%n);
      |       ^
a.cc:7:7: error: missing terminating " character
    7 | scanf("%d,%n);
      |       ^~~~~~~~
a.cc:27:11: warning: missing terminating " character
   27 |    printf("%d\n%d\n,a[n-1],m);
      |           ^
a.cc:27:11: error: missing terminating " character
   27 |    printf("%d\n%d\n,a[n-1],m);
      |           ^~~~~~~~~~~~~~~~~~~~
a.cc: In function 'int main()':
a.cc:8:1: error: expected primary-expression before 'for'
    8 | for(i=0;i<n;i++){
      | ^~~
a.cc:8:16: error: expected ';' before ')' token
    8 | for(i=0;i<n;i++){
      |                ^
      |                ;
a.cc:28:2: error: expected primary-expression before 'return'
   28 |  return 0;
      |  ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){ 
    int N; cin >> N;
    vector<int> v;
    for(int i=0; i<N; i++){
        int a; cin >> a;
        v.push_back(a);
    }
    int cnt = 0;
    for(int i = 0; i <= N-1; i++){
        int minV = i;
        for(int j = i; j <= N-1; j++){
            if(v[j] < v[minV]){
                minV = j;
            }
        }
        if(v[i] > v[minV]   
           swap(v[i], v[minV]);
           cnt++;
           }
    }
    for(int i = 0; i < N; i++){
        if(i == N-1){
            cout << v[i] << endl;
            break;
        }
        cout << v[i] << " ";
    }
    cout << cnt << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:26: error: expected ';' before 'swap'
   18 |         if(v[i] > v[minV]
      |                          ^
      |                          ;
   19 |            swap(v[i], v[minV]);
      |            ~~~~           
a.cc:20:17: error: expected ')' before ';' token
   20 |            cnt++;
      |                 ^
      |                 )
a.cc:18:11: note: to match this '('
   18 |         if(v[i] > v[minV]
      |           ^
a.cc: At global scope:
a.cc:23:5: error: expected unqualified-id before 'for'
   23 |     for(int i = 0; i < N; i++){
      |     ^~~
a.cc:23:20: error: 'i' does not name a type
   23 |     for(int i = 0; i < N; i++){
      |                    ^
a.cc:23:27: error: 'i' does not name a type
   23 |     for(int i = 0; i < N; i++){
      |                           ^
a.cc:30:5: error: 'cout' does not name a type
   30 |     cout << cnt << endl;
      |     ^~~~
a.cc:31:5: error: expected unqualified-id before 'return'
   31 |     return 0;
      |     ^~~~~~
a.cc:32:1: error: expected declaration before '}' token
   32 | }
      | ^
Language: C++

selectionSort(A, N){                                                                                        
  int i, minj, j, t, c = 0;                                                                                 
  for(i = 0; i < N; i++){                                                                                   
    minj = i;                                                                                               
    for(j = i; j < n; j++){                                                                                 
      if(A[j] < A[minj]){                                                                                   
        minj = j;                                                                                           
      }                                                                                                     
    }                                                                                                       
    if(i != minj){                                                                                          
      t = A[i];                                                                                             
      A[i] = A[minj];                                                                                       
      A[minj] = t;                                                                                          
      c++;                                                                                                  
    }                                                                                                       
  }                                                                                                         
  for(i = 0; i < N; i++){                                                                                   
    printf("%d ",A[i]);                                                                                     
  }                                                                                                         
  printf("\n%d\n", c);                                                                                      
}

Compiler output:
a.cc:1:14: error: expected constructor, destructor, or type conversion before '(' token
    1 | selectionSort(A, N){
      |              ^
Language: C++

void selectionSort(A, N){                                                                                        
  int i, minj, j, t, c = 0;                                                                                 
  for(i = 0; i < N; i++){                                                                                   
    minj = i;                                                                                               
    for(j = i; j < n; j++){                                                                                 
      if(A[j] < A[minj]){                                                                                   
        minj = j;                                                                                           
      }                                                                                                     
    }                                                                                                       
    if(i != minj){                                                                                          
      t = A[i];                                                                                             
      A[i] = A[minj];                                                                                       
      A[minj] = t;                                                                                          
      c++;                                                                                                  
    }                                                                                                       
  }                                                                                                         
  for(i = 0; i < N; i++){                                                                                   
    printf("%d ",A[i]);                                                                                     
  }                                                                                                         
  printf("\n%d\n", c);                                                                                      
}

Compiler output:
a.cc:1:6: error: variable or field 'selectionSort' declared void
    1 | void selectionSort(A, N){
      |      ^~~~~~~~~~~~~
a.cc:1:20: error: 'A' was not declared in this scope
    1 | void selectionSort(A, N){
      |                    ^
a.cc:1:23: error: 'N' was not declared in this scope
    1 | void selectionSort(A, N){
      |                       ^
Language: C++

#include<streamio>
#include<algorithm>

int selectionSort(int A[], int N) {
  int sw = 0;
  for ( int i = 0; i < N; i++){
    minj = i;
    for ( int j = i; j < N - 1; j++){
      if (A[j] < A[minj]) {
        minj = j;
      }
    }
    swap(A[minj], A[i]);
    sw++;
  }
  return sw;
}

int main() {
  int sw, N, A[100];
  cin >> N;
  
  for ( int i = 0; i < N; i++) cin >> A[i];
  
  sw = selectionSort(A, N);

  for ( int i = 0; i < N; i++) {
    if (i) cout << " ";
    cout << A[i];
  }
  cout << endl;
  cout << sw << endl;

  return 0;
}


Compiler output:
a.cc:1:9: fatal error: streamio: No such file or directory
    1 | #include<streamio>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include<streamio>
#include<algorithm>
 
int selectionSort(int A[], int N) {
  int sw = 0;
  for ( int i = 0; i < N; i++){
    minj = i;
    for ( int j = i; j < N - 1; j++){
      if (A[j] < A[minj]) {
        minj = j;
      }
    }
    std::swap(A[minj], A[i]);
    sw++;
  }
  return sw;
}
 
int main() {
  int sw, N, A[100];
  cin >> N;
   
  for ( int i = 0; i < N; i++) cin >> A[i];
   
  sw = selectionSort(A, N);
 
  for ( int i = 0; i < N; i++) {
    if (i) cout << " ";
    cout << A[i];
  }
  cout << endl;
  cout << sw << endl;
 
  return 0;
}


Compiler output:
a.cc:1:9: fatal error: streamio: No such file or directory
    1 | #include<streamio>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include<streamio>
#include<algorithm>

using namespace std;
  
int selectionSort(int A[], int N) {
  int sw = 0;
  for ( int i = 0; i < N; i++){
    minj = i;
    for ( int j = i; j < N - 1; j++){
      if (A[j] < A[minj]) {
        minj = j;
      }
    }
    swap(A[minj], A[i]);
    sw++;
  }
  return sw;
}
  
int main() {
  int sw, N, A[100];
  cin >> N;
    
  for ( int i = 0; i < N; i++) cin >> A[i];
    
  sw = selectionSort(A, N);
  
  for ( int i = 0; i < N; i++) {
    if (i) cout << " ";
    cout << A[i];
  }
  cout << endl;
  cout << sw << endl;
  
  return 0;
}


Compiler output:
a.cc:1:9: fatal error: streamio: No such file or directory
    1 | #include<streamio>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
 
using namespace std;
   
int selectionSort(int A[], int N) {
  int sw = 0;
  for ( int i = 0; i < N; i++){
    minj = i;
    for ( int j = i; j < N - 1; j++){
      if (A[j] < A[minj]) {
        minj = j;
      }
    }
    swap(A[minj], A[i]);
    sw++;
  }
  return sw;
}
   
int main() {
  int sw, N, A[100];
  cin >> N;
     
  for ( int i = 0; i < N; i++) cin >> A[i];
     
  sw = selectionSort(A, N);
   
  for ( int i = 0; i < N; i++) {
    if (i) cout << " ";
    cout << A[i];
  }
  cout << endl;
  cout << sw << endl;
   
  return 0;
}


Compiler output:
a.cc: In function 'int selectionSort(int*, int)':
a.cc:8:5: error: 'minj' was not declared in this scope
    8 |     minj = i;
      |     ^~~~
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
void selectionSort()
{
    int A[100];
    int N;
    cin >> N;
 
    for (int i = 0; i < N; i++)
    {
        cin >> A[i];
    }
    int ans = 0;
    for (int i = 0; i < N; i++)
    {
        int m = i;
        for (int j = i + 1; j < N; j++)
        {
            if (A[m] > A[j])
            {
                m = j;
            }
        }
 
        if (m != i)
        {
            int temp = A[i];
            A[i] = A[m];
            A[m] = temp
            ans++;
        }
    }
 
    for (int i = 0; i < N; i++)
    {
        if (i != N - 1)
        {
            cout << A[i] << " " << flush;
            continue;
        }
        else
        {
            cout << A[i] << endl;
        }
    }
 
    cout << ans << endl;
}
 
int main()
{
    selectionSort();
    return 0;
}


Compiler output:
a.cc: In function 'void selectionSort()':
a.cc:30:24: error: expected ';' before 'ans'
   30 |             A[m] = temp
      |                        ^
      |                        ;
   31 |             ans++;
      |             ~~~
Language: C++

void SelectionSort(int A[], int n)
{
	int min, i, j;
	for (i = 0; i < n-1; i++) {
		min = i;
		for (j = i + 1; j < n; j++)
			if (A[min] > A[j])
				min = j;
		if (min != i)
			swap(A[min], A[i]);
	}
}


Compiler output:
a.cc: In function 'void SelectionSort(int*, int)':
a.cc:10:25: error: 'swap' was not declared in this scope
   10 |                         swap(A[min], A[i]);
      |                         ^~~~
Language: C++

#include <stdio.h>
#define rep(i, n) for(int i = 0; i < n; ++i)
#define repi(i, n, a) for(int i = a; i < n; ++i)

int main(void) {
  int n, i, j, ans = 0;
  scanf("%d", &n);
  int a[n];
  rep(i, n) scanf("%d", &a[i]);
  int flag = 1;
  rep(i, n) {
    int minj = i, t;
    repi(j, n, i) if(a[j] < a[minj] minj = j;
    t = a[i], a[i] = a[minj], a[minj] = t;
    if(i != minj) ++ans;
  }
  rep(i, n) {
    if(i) printf(" %d", a[i]);
    else printf("%d", a[i]);
  }
  printf("\n%d\n", ans);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:36: error: expected ';' before 'minj'
   13 |     repi(j, n, i) if(a[j] < a[minj] minj = j;
      |                                    ^~~~~
      |                                    ;
a.cc:14:42: error: expected ')' before ';' token
   14 |     t = a[i], a[i] = a[minj], a[minj] = t;
      |                                          ^
      |                                          )
a.cc:13:21: note: to match this '('
   13 |     repi(j, n, i) if(a[j] < a[minj] minj = j;
      |                     ^
Language: C++

#include <iostream>
using namespace std;
const int MAX = 100;

int main()
{
	int n, mini, temp, count=0;
	int A[MAX];

	cin >> n;
	for(int i = 0; i < n; i++)
	{
		cin >> A[i];
	}

	for(int i = 0; i < n; i++)
	{
		mini = i;
		for(int j = i+1; i < n; j++)
		{
			if(A[mini] > A[j])
				mini = i;
		}
		if(i != mini)
		{
			count++;
			temp = mini;
			A[i] = A[mini];
			A[mini] = temp;
		}
	}

	for(int i = 0; i < n-1; i++)
	{
		cout << A[i] << ' '
	}
	cout << A[n-1] << endl;
	count << count << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:35:36: error: expected ';' before '}' token
   35 |                 cout << A[i] << ' '
      |                                    ^
      |                                    ;
   36 |         }
      |         ~                           
a.cc:38:24: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   38 |         count << count << endl;
      |         ~~~~~~~~~~~~~~~^~~~~~~
Language: C++

#include <iostream>
using namespace std;
const int MAX = 100;

int main()
{
	int n, mini, temp, count=0;
	int A[MAX];

	cin >> n;
	for(int i = 0; i < n; i++)
	{
		cin >> A[i];
	}

	for(int i = 0; i < n; i++)
	{
		mini = i;
		for(int j = i+1; i < n; j++)
		{
			if(A[mini] > A[j])
				mini = i;
		}
		if(i != mini)
		{
			count++;
			temp = mini;
			A[i] = A[mini];
			A[mini] = temp;
		}
	}

	for(int i = 0; i < n-1; i++)
	{
		cout << A[i] << ' ';
	}
	cout << A[n-1] << endl;
	count << count << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:24: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   38 |         count << count << endl;
      |         ~~~~~~~~~~~~~~~^~~~~~~
Language: C++

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String args[]) throws Exception
	{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String ns = br.readLine();
		int n = Integer.parseInt(ns);

		String as = br.readLine();
		String[] as_ary = as.split(" ");

		int[] a_ary = new int[n];
		for (int i = 0; i < n; i++) {
			a_ary[i] = Integer.parseInt(as_ary[i]);
		}

		int minj;
		int min;
		int count = 0;
		for (int i = 0; i < n; i++) {
			minj = i;
			for (int j = i + 1; j < n; j++) {
				if (a_ary[j] < a_ary[minj]) {
					minj = j;
				}
			}

			if (i != minj) {
				count += 1;
				min = a_ary[minj];
				a_ary[minj] = a_ary[i];
				a_ary[i] = min;
			}
		}

		for (int i = 0; i < n; i++) {
			System.out.printf(a_ary[i] + (i != n - 1 ? " ": ""));
		}
		System.out.println("\n"+count);
	}
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.io.BufferedReader;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: 'import' does not name a type
    2 | import java.io.InputStreamReader;
      | ^~~~~~
a.cc:2:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:4:1: error: expected unqualified-id before 'public'
    4 | public class Main {
      | ^~~~~~
Language: C++

import java.util.Scanner;
public class Main {
	public static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int i, j, k;
		int n = sc.nextInt();
		int a[] = new int[n];
		
		for(i = 0; i < n; i++){
			a[i] = sc.nextInt();
		}
		
		selectionsort(n, a);
	}
	public static void selectionsort(int n, int a[]){
		int count = 0;
		for (int i = 0; i <= n - 1; i++){
			int minj = i;
			for(int j = i; j <= n - 1; j++){
				if(a[j] < a[minj]){
					minj = j;
				}
			}
			if(a[i] != a[minj]) count++;
			int temp = a[i];
			a[i] = a[minj];
			a[minj] = temp;
		}
		for(int i = 0; i < n; i++){
			System.out.print(( i == 0 ? "" : " ") + a[i]);
		}
		
		System.out.printf("\n%d\n", count);
	}
}


Compiler output:
a.cc:1:1: error: 'import' does not name a type
    1 | import java.util.Scanner;
      | ^~~~~~
a.cc:1:1: note: C++20 'import' only available with '-fmodules-ts'
a.cc:2:1: error: expected unqualified-id before 'public'
    2 | public class Main {
      | ^~~~~~
Language: C++

#include<stdio.h>

int selectionSort(int A[], int N){
  int minj;
  int sw = 0;
  for ( i = 0; i < N; i++) {
    minj = i;
    for ( j = i; j < N; j++) {
      if (A[j] < A[minj]) {
        minj = j;
      }
    sw++;
  return sw;
}

int main(){
  int A[100], N, i, sw;

  scanf("%d", &N);
  for ( i = 0; i < N; i++) scanf("%d", &A[i]);

  sw = selectionSort(A, N);

  for ( i = 0; i < N; i++ ){
    if ( i > 0 ) printf(" ");
    printf("%d", A[i]);
  }
  printf("\n")
  printf("%d\n", sw);

  return 0;
}


Compiler output:
a.cc: In function 'int selectionSort(int*, int)':
a.cc:6:9: error: 'i' was not declared in this scope
    6 |   for ( i = 0; i < N; i++) {
      |         ^
a.cc:8:11: error: 'j' was not declared in this scope
    8 |     for ( j = i; j < N; j++) {
      |           ^
a.cc:16:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   16 | int main(){
      |         ^~
a.cc:16:9: note: remove parentheses to default-initialize a variable
   16 | int main(){
      |         ^~
      |         --
a.cc:16:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:16:11: error: a function-definition is not allowed here before '{' token
   16 | int main(){
      |           ^
a.cc:32:2: error: expected '}' at end of input
   32 | }
      |  ^
a.cc:6:28: note: to match this '{'
    6 |   for ( i = 0; i < N; i++) {
      |                            ^
a.cc:32:2: error: expected '}' at end of input
   32 | }
      |  ^
a.cc:3:34: note: to match this '{'
    3 | int selectionSort(int A[], int N){
      |                                  ^
a.cc:32:2: warning: control reaches end of non-void function [-Wreturn-type]
   32 | }
      |  ^
Language: C++

#include<stdio.h>

int selectionSort(int A[], int N){
  int minj;
  int sw = 0;
  for ( i = 0; i < N; i++) {
    minj = i;
    for ( j = i; j < N; j++) {
      if (A[j] < A[minj]) {
        minj = j;
      }
    sw++;
  return sw;
}

int main(){
  int A[100], N, i, sw;

  scanf("%d", &N);
  for ( i = 0; i < N; i++) scanf("%d", &A[i]);

  sw = selectionSort(A, N);

  for ( i = 0; i < N; i++ ){
    if ( i > 0 ) printf(" ");
    printf("%d", A[i]);
  }
  printf("\n");
  printf("%d\n", sw);

  return 0;
}


Compiler output:
a.cc: In function 'int selectionSort(int*, int)':
a.cc:6:9: error: 'i' was not declared in this scope
    6 |   for ( i = 0; i < N; i++) {
      |         ^
a.cc:8:11: error: 'j' was not declared in this scope
    8 |     for ( j = i; j < N; j++) {
      |           ^
a.cc:16:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   16 | int main(){
      |         ^~
a.cc:16:9: note: remove parentheses to default-initialize a variable
   16 | int main(){
      |         ^~
      |         --
a.cc:16:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:16:11: error: a function-definition is not allowed here before '{' token
   16 | int main(){
      |           ^
a.cc:32:2: error: expected '}' at end of input
   32 | }
      |  ^
a.cc:6:28: note: to match this '{'
    6 |   for ( i = 0; i < N; i++) {
      |                            ^
a.cc:32:2: error: expected '}' at end of input
   32 | }
      |  ^
a.cc:3:34: note: to match this '{'
    3 | int selectionSort(int A[], int N){
      |                                  ^
a.cc:32:2: warning: control reaches end of non-void function [-Wreturn-type]
   32 | }
      |  ^
Language: C++

#include<stdio.h>

int selectionSort(int A[], int N){
  int minj;
  int sw = 0;
  for ( i = 0; i < N; i++) {
    minj = i;
    for ( j = i; j < N; j++) {
      if (A[j] < A[minj]) {
        minj = j;
      }
    }
    sw++;
  }
  return sw;
}

int main(){
  int A[100], N, i, sw;

  scanf("%d", &N);
  for ( i = 0; i < N; i++) scanf("%d", &A[i]);

  sw = selectionSort(A, N);

  for ( i = 0; i < N; i++ ){
    if ( i > 0 ) printf(" ");
    printf("%d", A[i]);
  }
  printf("\n");
  printf("%d\n", sw);

  return 0;
}


Compiler output:
a.cc: In function 'int selectionSort(int*, int)':
a.cc:6:9: error: 'i' was not declared in this scope
    6 |   for ( i = 0; i < N; i++) {
      |         ^
a.cc:8:11: error: 'j' was not declared in this scope
    8 |     for ( j = i; j < N; j++) {
      |           ^
Language: C++

#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define EACH(i, c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort((c).begin(), (c).end())
#define CLR(a) memset((a), 0, sizeof(a))
#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
                      << " " << __FILE__ << endl;
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())

//using LL = long long;
using namespace std;

const int dy[] = {0, 0, 1, -1};
const int dx[] = {1, -1, 0, 0};
const double EPS = 1e-10;
const double PI = acos(-1.0);

void print(vector<int> v)
{
    int n = v.size();
    for (int i = 0; i < n; i++)
    {
        if (i)
            cout << ' ';
        cout << v[i];
    }
    cout << endl;
}

int selection_Sort(int a[], int n)
{
    int sw = 0;
    int min_j = 0;
    int = 0;
    for(int i=0; i<n-1; i++){
        min_j = i;
        for(int j=0; j<n; j++){
            if (a[j] < a[min_j])
                min_j = j;
        }

        t = a[i];
        a[i] = a[min_j];
        a[min_j] = t;

        if (i != min_j) sw++;
            
    }

    return sw;
}

signed main()
{
    //cin.tie(0);
    //ios::sync_with_stdio(false);

    int n;
    cin >> n;

    //vector<int> v;
    int a[100];
    REP(i, n)
    {
        // int num;
        // cin >> num;
        // v.PB(num);

        cin >> a[i];
    }

    int sw = selection_Sort(v, n);

    REP(i,n){
        if(i>0) cout << " ";
        cout << a[i];
    }

    cout << "\n" << sw << endl;
}


Compiler output:
a.cc: In function 'int selection_Sort(int*, int)':
a.cc:41:9: error: expected unqualified-id before '=' token
   41 |     int = 0;
      |         ^
a.cc:49:9: error: 't' was not declared in this scope
   49 |         t = a[i];
      |         ^
a.cc: In function 'int main()':
a.cc:79:29: error: 'v' was not declared in this scope
   79 |     int sw = selection_Sort(v, n);
      |                             ^
Language: C++

#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define EACH(i, c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort((c).begin(), (c).end())
#define CLR(a) memset((a), 0, sizeof(a))
#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
                      << " " << __FILE__ << endl;
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())

//using LL = long long;
using namespace std;

const int dy[] = {0, 0, 1, -1};
const int dx[] = {1, -1, 0, 0};
const double EPS = 1e-10;
const double PI = acos(-1.0);

printVec(vector<int> v, int n)
{
    for (int i = 0; i < n; i++)
    {
        if (i)
            cout << ' ';
        cout << v[i];
    }
}

selection_Sort(vector<int> v, int n){
    int mini, count = 0;
    for (int i = 0; i < n - 1; i++)
    {
        mini = i;
        for (int j = i + 1; j < n; j++)
        {
            if (v[j] < v[mini])
                mini = j;
        }

        if (i != mini)
        {
            count++;
            swap(v[i], v[mini]);
        }
    }

    printVec(v,n);
    cout << endl
         << count << endl;
}

int main()
{
    
    cin >> n;
    vector<int> v;
    int temp;
    for (; cin >> temp;)
    {
        v.push_back(temp);
    }

    

    return 0;
}


Compiler output:
a.cc:25:1: error: ISO C++ forbids declaration of 'printVec' with no type [-fpermissive]
   25 | printVec(vector<int> v, int n)
      | ^~~~~~~~
a.cc: In function 'int printVec(std::vector<int>, int)':
a.cc:33:1: warning: no return statement in function returning non-void [-Wreturn-type]
   33 | }
      | ^
a.cc: At global scope:
a.cc:35:1: error: ISO C++ forbids declaration of 'selection_Sort' with no type [-fpermissive]
   35 | selection_Sort(vector<int> v, int n){
      | ^~~~~~~~~~~~~~
a.cc: In function 'int selection_Sort(std::vector<int>, int)':
a.cc:56:1: warning: no return statement in function returning non-void [-Wreturn-type]
   56 | }
      | ^
a.cc: In function 'int main()':
a.cc:61:12: error: 'n' was not declared in this scope; did you mean 'yn'?
   61 |     cin >> n;
      |            ^
      |            yn