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

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

using namespace std;

int comp(const void *a, const void *b){
	const int *a_ = a, *b_ = b;
	return a-b;
}

int main(){
	int s[100000],t;
	int i,j,sn,tn,n=0;
	cin>>sn;
	for(i=0;i<sn;i++){
		cin>>s[i];
	}
	sort(s,s+sn);
	cin>>tn;
	for(i=0;i<tn;i++){
		cin>>t;
		if(bsearch(&t,s,sn,sizeof(int), comp)!= NULL){
			n++;
		}
	}
	cout<<n<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int comp(const void*, const void*)':
a.cc:8:25: error: invalid conversion from 'const void*' to 'const int*' [-fpermissive]
    8 |         const int *a_ = a, *b_ = b;
      |                         ^
      |                         |
      |                         const void*
a.cc:8:34: error: invalid conversion from 'const void*' to 'const int*' [-fpermissive]
    8 |         const int *a_ = a, *b_ = b;
      |                                  ^
      |                                  |
      |                                  const void*
a.cc:9:18: error: invalid use of 'const void'
    9 |         return a-b;
      |                  ^
Language: C++

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

using namespace std;

int comp(const void *a, const void *b){
	const int *a_ = a, *b_ = b;
	return *a_-*b_;
}

int main(){
	int s[100000],t;
	int i,j,sn,tn,n=0;
	cin>>sn;
	for(i=0;i<sn;i++){
		cin>>s[i];
	}
	sort(s,s+sn);
	cin>>tn;
	for(i=0;i<tn;i++){
		cin>>t;
		if(bsearch(&t,s,sn,sizeof(int), comp)!= NULL){
			n++;
		}
	}
	cout<<n<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int comp(const void*, const void*)':
a.cc:8:25: error: invalid conversion from 'const void*' to 'const int*' [-fpermissive]
    8 |         const int *a_ = a, *b_ = b;
      |                         ^
      |                         |
      |                         const void*
a.cc:8:34: error: invalid conversion from 'const void*' to 'const int*' [-fpermissive]
    8 |         const int *a_ = a, *b_ = b;
      |                                  ^
      |                                  |
      |                                  const void*
Language: C++


import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc =new Scanner(System.in);
		int count=0;
		int slength=sc.nextInt();
		int tt=0;
		int S[]=new int[slength];
		for(int i=0;i<slength;i++){
			int ss=sc.nextInt();
			S[i]=ss;
		}
		int tlength=sc.nextInt();
		for(int j=0;j<tlength;j++){
			tt=sc.nextInt();
			for(int k=0;k<slength;k++){
				if(S[k]==tt){
					count++;
					break;
				}
			}
		}
		System.out.println(count);
	}
}

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



import java.util.Scanner;

public class JavaApplication2 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            int n = Integer.valueOf(sc.nextLine());
            int[] ints = new int[n];
            for(int i = 0; i < n; i++){
                ints[i]=sc.nextInt();
            }
            Qsorted(ints,0,n-1);
        }
        
    }
    static void printArray(int[] ints){
        System.out.println(ints[0]);
        for(int i=1; i<ints.length; i++){
            System.out.println(" "+ints[i]);
        }
        System.out.println("");
    }
    static void Qsorted(int[] ints,int left, int right){
        int pivot = ints[(right+left)/2];
        int i=left, j=right;
        while(true){
            while(ints[i]<pivot&&i<=right)i++;
            while(ints[j]>pivot&&j>=left)j--;
            if(i<=j)break ;
            int tmp = ints[i]; ints[i]=ints[j]; ints[j]=tmp;
            i++;j--;        
        }
        if(i!=left)Qsorted(ints,left,i-1);
        if(i!=right)Qsorted(ints,i,right);
    }

}

Compiler output:
Main.java:5: error: class JavaApplication2 is public, should be declared in a file named JavaApplication2.java
public class JavaApplication2 {
       ^
1 error
Language: Java

import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Scanner;

public class RdiSort {

    private static void radixSort(int[] a) {
	ArrayList<ArrayDeque<Integer>> buckets = new ArrayList<ArrayDeque<Integer>>(10);
	for (int i = 0; i < 10; i++) {
	    buckets.add(new ArrayDeque<Integer>());
	}

	for (int b : a) {
	    buckets.get(9).add(b);
	}

	int cur = 1;
	while (buckets.get(0).size() < a.length) {
	    for (ArrayDeque<Integer> deque : buckets) {
		int size = deque.size();
		for (int s = 0; s < size; s++) {
		    int p = deque.poll();
		    int digit = p / cur;
		    digit %= 10;
		    buckets.get(digit).add(p);
		}
	    }
	    cur *= 10;
	}

	for (int i = 0; i < a.length; i++) {
	    a[i] = buckets.get(0).poll();
	}
    }

    public static void main(String[] args) {
	Scanner scanner = new Scanner(System.in);
	int N = scanner.nextInt();
	int[] a = new int[N];
	for (int i = 0; i < a.length; i++) {
	    a[i] = scanner.nextInt();
	}
	radixSort(a);
	StringBuilder builder = new StringBuilder();
	for (int i = 0; i < a.length; i++) {
	    if (i > 0) {
		builder.append(" ");
	    }
	    builder.append(a[i]);
	}
	System.out.println(builder.toString());
	scanner.close();
    }
}

Compiler output:
Main.java:5: error: class RdiSort is public, should be declared in a file named RdiSort.java
public class RdiSort {
       ^
1 error
Language: Java

import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Scanner;

public class RdiSort {

    private static void radixSort(int[] a) {
	ArrayList<ArrayDeque<Integer>> buckets = new ArrayList<ArrayDeque<Integer>>(
		10);
	for (int i = 0; i < 10; i++) {
	    buckets.add(new ArrayDeque<Integer>());
	}

	for (int b : a) {
	    buckets.get(9).add(b);
	}

	int cur = 1;
	while (buckets.get(0).size() < a.length) {
	    for (ArrayDeque<Integer> deque : buckets) {
		int size = deque.size();
		for (int s = 0; s < size; s++) {
		    int p = deque.poll();
		    int digit = p / cur;
		    digit %= 10;
		    buckets.get(digit).add(p);
		}
	    }
	    cur *= 10;
	}

	for (int i = 0; i < a.length; i++) {
	    a[i] = buckets.get(0).poll();
	}
    }

    public static void main(String[] args) {
	Scanner scanner = new Scanner(System.in);
	int N = scanner.nextInt();
	int[] a = new int[N];
	for (int i = 0; i < a.length; i++) {
	    a[i] = scanner.nextInt();
	}
	radixSort(a);
	StringBuilder builder = new StringBuilder();
	for (int i = 0; i < a.length; i++) {
	    if (i > 0) {
		builder.append(" ");
	    }
	    builder.append(a[i]);
	}
	System.out.println(builder.toString());
	scanner.close();
    }
}

Compiler output:
Main.java:5: error: class RdiSort is public, should be declared in a file named RdiSort.java
public class RdiSort {
       ^
1 error
Language: Java

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

class Main {
    public static void main(String[] a) throws Exception {
        BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(r.readLine());
        String[] str = r.readLine().split(" ");

        int[] arr = strToIntArray(str);
        int maxValue = maxValue(arr);

        int[] bucket = new int[maxValue + 1];
        for (int i = 0; i < n; i++) {
            bucket[arr[i]] += 1;
        }

        int index = 0;
        for (int i = 0; i < bucket.length; i++) {
            while (bucket[i] > 0) {
                arr[index] = i;
                bucket[i] --;
                index ++;
            }
        }

        StringBuilder s = new StringBuilder();
        for (int i = 0; i < n; i++) {
            s.append(arr[i]);
            if (i != n - 1) {
                s.append(" ");
            }
        }

        System.out.println(s);
    }

    private static int[] strToIntArray(String[] str) {
        int[] arr = new int[str.length];
        for (int i = 0; i < str.length; i++) {
            arr[i] = Integer.parseInt(str[i]);
        }
        return arr;
    }

    private static int maxValue(int[] arr) {
        int max = -1;
        for (int i = 0; i < n; i++) {
            if (arr[i] > max) {
                max = arr[i];
            }
        }
        return max;
    }
}

/*
??\???????????????
34
33 43 62 29 8 52 56 56 19 11 51 43 5 8 93 30 66 69 32 17 47 72 68 80 23 49 92 64 69 51 27 90 24 5499

6
5 4 3 2 1 5499
*/

Compiler output:
Main.java:48: error: cannot find symbol
        for (int i = 0; i < n; i++) {
                            ^
  symbol:   variable n
  location: class Main
1 error
Language: Java

import java.util.*;

public class AOJ_10029 {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n];
		for(int i=0;i<n;i++){
			a[i] = sc.nextInt();
		}
		Arrays.sort(a);
		for(int i=0;i<n;i++){
			if(i!=0)System.out.print(" ");
			System.out.print(a[i]);
		}
		System.out.println();
	}
}

Compiler output:
Main.java:3: error: class AOJ_10029 is public, should be declared in a file named AOJ_10029.java
public class AOJ_10029 {
       ^
1 error
Language: Java

import java.util.Arrays;
import java.util.Scanner;

public class aoj10029 {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
			String n_str = sc.next();
			Integer n = Integer.valueOf(n_str);
			long[] num = new long[n];
		for(int i = 0;i != n; i++)
		{
			num[i] = sc.nextLong();
		}
			Arrays.sort(num);
		for(int i = 0;i != n; i++)
		{
			if(i < n-1)
			{
				System.out.print(num[i] + " ");
			} else {
				System.out.println(num[i]);
			}
		}
	}
}

Compiler output:
Main.java:4: error: class aoj10029 is public, should be declared in a file named aoj10029.java
public class aoj10029 {
       ^
1 error
Language: Java

import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Scanner;


public class Main{
	public static void main(String[] args){
		Scanner scan = null;
		try{
			scan = new Scanner(System.in);
			int n =  scan.nextInt();
			List<Integer> list = new ArrayList<Integer>();
			for(int i = 0 ; i < n ; i++){
				list.add(scan.nextInt());
			}
			Collections.sort(list);
			Iterator it = list.iterator();
			System.out.print(it.next());
			while(it.hasNext()){
				System.out.print(" "+it.next());
			}
			System.out.println();
		}finally{
			scan.close();
		}
	}
}import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.Scanner;


public class Main{
	public static void main(String[] args){
		Scanner scan = null;
		try{
			scan = new Scanner(System.in);
			int n =  scan.nextInt();
			List<Integer> list = new ArrayList<Integer>();
			for(int i = 0 ; i < n ; i++){
				list.add(scan.nextInt());
			}
			Collections.sort(list);
			Iterator it = list.iterator();
			System.out.print(it.next());
			while(it.hasNext()){
				System.out.print(" "+it.next());
			}
			System.out.println();
		}finally{
			scan.close();
		}
	}
}

Compiler output:
Main.java:29: error: class, interface, enum, or record expected
}import java.util.ArrayList;
 ^
Main.java:30: error: class, interface, enum, or record expected
import java.util.Collections;
^
Main.java:31: error: class, interface, enum, or record expected
import java.util.Iterator;
^
Main.java:32: error: class, interface, enum, or record expected
import java.util.List;
^
Main.java:33: error: class, interface, enum, or record expected
import java.util.Scanner;
^
5 errors
Language: C

#include<stdio.h>
int main(void)
{
	double n;
	scanf("%lf",&n);
double i,j,su[1000000],max,temp;
for(i=1;i<=n;i++){
	max=i;
	for(j=i+1;j<=n;j++){
		if(su[max]<su[j]){
			temp=su[max];
			su[max]=su[j];
			su[j]=su[max];
		}
}
}
for(i=1;i<=n;i++){
printf(" ");
printf("%d",su[i]);
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:22: error: array subscript is not an integer
   10 |                 if(su[max]<su[j]){
      |                      ^
main.c:10:30: error: array subscript is not an integer
   10 |                 if(su[max]<su[j]){
      |                              ^
main.c:11:32: error: array subscript is not an integer
   11 |                         temp=su[max];
      |                                ^
main.c:12:27: error: array subscript is not an integer
   12 |                         su[max]=su[j];
      |                           ^
main.c:12:35: error: array subscript is not an integer
   12 |                         su[max]=su[j];
      |                                   ^
main.c:13:27: error: array subscript is not an integer
   13 |                         su[j]=su[max];
      |                           ^
main.c:13:33: error: array subscript is not an integer
   13 |                         su[j]=su[max];
      |                                 ^
main.c:19:15: error: array subscript is not an integer
   19 | printf("%d",su[i]);
      |               ^
Language: C

#include<stdio.h>
int main(void)
{
	int n;
int i,j,max=0,temp=0,a;
 int su[1000000];
	scanf("%d",&n);
for(i=0;i<n;i++){
	scanf("%d",&a);
	su[i]=a;
}
for(i=0;i<n;i++){
	max=i;
	for(j=i+1;j<n;j++){
		if(su[max]<su[j]){
			temp=su[max];
			su[max]=su[j];
			su[j]=temp;
		}
}
}
for(i=0;i<n;i++){
printf(" ");
printf("%d",su[i]);
}
return 0;
}
for(i=1;i<=n;i++){
printf(" ");
printf("%d",su[i]);
}
return 0;
}

Compiler output:
main.c:28:1: error: expected identifier or '(' before 'for'
   28 | for(i=1;i<=n;i++){
      | ^~~
main.c:28:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
   28 | for(i=1;i<=n;i++){
      |          ^~
main.c:28:15: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   28 | for(i=1;i<=n;i++){
      |               ^~
main.c:32:1: error: expected identifier or '(' before 'return'
   32 | return 0;
      | ^~~~~~
main.c:33:1: error: expected identifier or '(' before '}' token
   33 | }
      | ^
Language: C

#include <stdio.h>

char bucket[10000001];

int main(void)
{
	int n;
	int i;
	int max = 0;
	
	scanf("%d", &n);
	for (i = 0; i < n; i++){
		int t;
		
		scanf("%d", &t);
		bucket[t]++;
		if (max < t){
			max = t;
		}
	}
	for (i = 0; i < n; i++){
		while (same[t] > 0){
			printf("%d%c", t, "\0 " + (same[t] > 1));
		}
		printf("%c", "\n " + (i < max));
	}
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:22:24: error: 'same' undeclared (first use in this function)
   22 |                 while (same[t] > 0){
      |                        ^~~~
main.c:22:24: note: each undeclared identifier is reported only once for each function it appears in
main.c:22:29: error: 't' undeclared (first use in this function)
   22 |                 while (same[t] > 0){
      |                             ^
Language: C

#include<cstdio>
#include<algorithm>

using namespace std;

int a[1000000];

int main(void)
{
	int i;
	int n;
	
	scanf("%d", &n);
	
	for (i = 0; i < n; i++) {
		scanf("%d", &a[i]);
	}
	
	sort(a, a + n);
	
	for (i = 0; i < n; i++) {
		if (i == 0) {
			printf("%d", a[i]);
		}
		else {
			printf(" %d", a[i]);
		}
	}
	printf("\n");
	
	return (0);
}

Compiler output:
main.c:1:9: fatal error: cstdio: No such file or directory
    1 | #include<cstdio>
      |         ^~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>

void quick(int num[], int left, int right);

int main(void)
{
	int i, n;
	int num[1000000];

	scanf("%d", &n);

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

	quick(num, 0, n - 1);

	for(i = 0;i < n - 1;i++){
		printf("%d ", num[i]);
	}
	printf("%d\n", num[n]);

	return 0;
}

void quick(int num[], int left, int right)
{
	int i, j, center, keep;

	i = left;
	j = right;

	center = num[(left + right) / 2];

	while(1){
		while(center < num[i]){
			i++;
		}

		while(num[j] < center){
			j--;
		}

		if(i >= j) break;

		keep = num[i];
		num[i] = num[j];
		num[j] = keep;

		i++;
		j--
	}

	if(left < i - 1){
		quick(num, left, i - 1);
	}

	if(j + 1 < right){
		quick(num, j + 1, right);
	}

}

Compiler output:
main.c: In function 'quick':
main.c:51:20: error: expected ';' before '}' token
   51 |                 j--
      |                    ^
      |                    ;
   52 |         }
      |         ~
Language: C

#include <stdio.h>
#include <stdlib.h>
#define N 1000000

int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}
int main(void){
  int n,i;
  int a[N];

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

  qsort(a, n, sizeof(int), compare_int);
  for(i=0;i<n;i++){
    if(i!=0){
      printf(" ");
    printf("%d", a[i]);
  }
  printf("\n");

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:27:1: error: expected declaration or statement at end of input
   27 | }
      | ^
Language: C

include<stdio.h>
#define M 1000001

int main(){
  int n,x[M]={};
  int i,j,temp;

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

  for (i=0;i<n-1;i++){
    for (j=n-1;j>i;j--){
      if (x[j-1]>x[j]){
	temp=x[j];
	x[j]=x[j-1];
	x[j-1]=temp;
      }
    }
  }
  
  for(i=0;i<n;i++) printf("%d ",x[i]);
  printf("\n");

  return 0;
}

Compiler output:
main.c:1:8: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
    1 | include<stdio.h>
      |        ^
Language: C

#include <stdio.h>

void quicksort(int array[], int left, int right);

int main(){
	int a[10000];
	int i, n;
	scanf("%d", &n);
	for(i=0;i<n;i++)
		scanf("%d", &a[i]);
	quicksort(a, 0, n-1);
	for(i=0;i<n;i++)
		printf("%d ", a[i]);
	printf("\n");
	return 0;
}

void quicksort(int array[], int left, int right) {
    int l = left;
    int r = right;
    int pivot = array[(left + right) / 2]; // ?????????????????????????????????
    int buf;

    while (1) {
        while (array[l] < pivot) l++;
        while (array[r] > pivot) r--;

        if (l > r) break;

        // pivot???????°?????????????????????§????????????????????\?????????
        buf = array[l];
        array[l] = array[r];
        array[r] = buf;

        l++, r--;
    };

Compiler output:
main.c: In function 'quicksort':
main.c:36:5: error: expected declaration or statement at end of input
   36 |     };
      |     ^
Language: C

#include <stdio.h>

void quicksort(int array[], int left, int right);

int main(){
	int a[10000];
	int i, n;
	scanf("%d", &n);
	for(i=0;i<n;i++)
		scanf("%d", &a[i]);
	quicksort(a, 0, n-1);
	for(i=0;i<n;i++)
		printf("%d ", a[i]);
	printf("\n");
	return 0;
}

void quicksort(int array[], int left, int right) {
    int l = left;
    int r = right;
    int pivot = array[(left + right) / 2]; // ?????????????????????????????????
    int buf;

    while (1) {
        while (array[l] < pivot) l++;
        while (array[r] > pivot) r--;

        if (l > r) break;

        // pivot???????°?????????????????????§????????????????????\?????????
        buf = array[l];
        array[l] = array[r];
        array[r] = buf;

        l++, r--;
    }

Compiler output:
main.c: In function 'quicksort':
main.c:36:5: error: expected declaration or statement at end of input
   36 |     }
      |     ^
Language: C

#include <stdio.h>

void quicksort(int array[], int left, int right);

int main(){
	int a[10000];
	int i, n;
	scanf("%d", &n);
	for(i=0;i<n;i++)
		scanf("%d", &a[i]);
	quicksort(a, 0, n-1);
	for(i=0;i<n;i++)
		printf("%d ", a[i]);
	printf("\n");
	return 0;
}

void quicksort(int array[], int left, int right) {
    int l = left;
    int r = right;
    int pivot = array[(left + right) / 2]; // ?????????????????????????????????
    int buf;

    while (1) {
        while (array[l] < pivot) l++;
        while (array[r] > pivot) r--;

        if (l > r) break;

        // pivot???????°?????????????????????§????????????????????\?????????
        buf = array[l];
        array[l] = array[r];
        array[r] = buf;

        l++;
        r--;
    }

Compiler output:
main.c: In function 'quicksort':
main.c:37:5: error: expected declaration or statement at end of input
   37 |     }
      |     ^
Language: C

#include<stdio.h>
#define MAX_N 10000000

void push(int);
int pop(void);

int heap[MAX_N],size=0;

int main(void){
  int n,x,i;
  
 scanf("%d",&n);

for(i=0;i<n;i++){
scanf("%d",&x);
    push(x);
  }
for(i=0;i<n;i++)
  printf("%d ",pop());
printf("\n");
  
  return 0;
}

void push(int x){
  int i,p;
  
  int i=size++;
  
  while(i>0){
    p=(i-1)/2;
    
    if(heap[p]<=x)break;
    
    heap[i]=heap[p];
    i=p;
  }
  heap[i]=x;
}

int pop(void){
  int ret,x,i=0,a,b;
  
  x=heap[--size];
  
  while(i*2+1<size){
    a=i*2+1;
    b=i*2+2;
    
    if(b<size && heap[b]<heap[a])a=b;
    
    if(heap[a]>x)break;
    
    heap[i]=heap[a];
    i=a;
  }
  heap[i]=x;
  
  return ret;
}

Compiler output:
main.c: In function 'push':
main.c:28:7: error: redeclaration of 'i' with no linkage
   28 |   int i=size++;
      |       ^
main.c:26:7: note: previous declaration of 'i' with type 'int'
   26 |   int i,p;
      |       ^
Language: C

#include<stdio.h>
int cmp(int* a,int* b){return *a<*b?-1:*a>*b;}

int main(void){
  int i=0,j=0,s[1000000];
  gets(s);
  for(;~scanf("%d",&s[i]);i++);
  qsort(s,i,4,cmp);
  for(;j<i;printf((j==i-1)?"%d\n":"%d ",s[j]),j++);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:3: error: implicit declaration of function 'gets'; did you mean 'fgets'? [-Wimplicit-function-declaration]
    6 |   gets(s);
      |   ^~~~
      |   fgets
main.c:8:3: error: implicit declaration of function 'qsort' [-Wimplicit-function-declaration]
    8 |   qsort(s,i,4,cmp);
      |   ^~~~~
Language: C

#include<stdio.h>
cmp(int* a){return *a-**1[&a];}

int main(void){
  int i=0,j=0,s[1000000];
  scanf("%d",s);
  for(;~scanf("%d",&s[i]);i++);
  qsort(s,i,4,cmp);
  for(;j<i;printf((j==i-1)?"%d\n":"%d ",s[j]),j++);
  return 0;
}

Compiler output:
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | cmp(int* a){return *a-**1[&a];}
      | ^~~
main.c: In function 'cmp':
main.c:2:23: error: invalid type argument of unary '*' (have 'int')
    2 | cmp(int* a){return *a-**1[&a];}
      |                       ^~~~~~~
main.c: In function 'main':
main.c:8:3: error: implicit declaration of function 'qsort' [-Wimplicit-function-declaration]
    8 |   qsort(s,i,4,cmp);
      |   ^~~~~
Language: C

i,j,s[1000000],n;
cmp(int* a){n=*a-*1[&a];}
main(){
  gets(s);
  for(;~scanf("%d",&s[i]);i++);
  qsort(s,i,4,cmp);
  for(;j<i;printf(j==i-1?"%d\n":"%d ",s[j]),j++);
  return 0;
}

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | i,j,s[1000000],n;
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'i' [-Wimplicit-int]
main.c:1:3: error: type defaults to 'int' in declaration of 'j' [-Wimplicit-int]
    1 | i,j,s[1000000],n;
      |   ^
main.c:1:5: error: type defaults to 'int' in declaration of 's' [-Wimplicit-int]
    1 | i,j,s[1000000],n;
      |     ^
main.c:1:16: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
    1 | i,j,s[1000000],n;
      |                ^
main.c:2:1: error: return type defaults to 'int' [-Wimplicit-int]
    2 | cmp(int* a){n=*a-*1[&a];}
      | ^~~
main.c:3:1: error: return type defaults to 'int' [-Wimplicit-int]
    3 | main(){
      | ^~~~
main.c: In function 'main':
main.c:4:3: error: implicit declaration of function 'gets' [-Wimplicit-function-declaration]
    4 |   gets(s);
      |   ^~~~
main.c:5:9: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    5 |   for(;~scanf("%d",&s[i]);i++);
      |         ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | i,j,s[1000000],n;
main.c:5:9: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
    5 |   for(;~scanf("%d",&s[i]);i++);
      |         ^~~~~
main.c:5:9: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:6:3: error: implicit declaration of function 'qsort' [-Wimplicit-function-declaration]
    6 |   qsort(s,i,4,cmp);
      |   ^~~~~
main.c:7:12: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
    7 |   for(;j<i;printf(j==i-1?"%d\n":"%d ",s[j]),j++);
      |            ^~~~~~
main.c:7:12: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:7:12: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:7:12: note: include '<stdio.h>' or provide a declaration of 'printf'
Language: C

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>

int a[1000000];

void isort(int p,int q){
	int i,j,x,num=q-p+1;
	for(i=1;i<num;i++){
		for(j=i;j>0;j--){
			if(a[p+j]<a[p+j-1]){
				x=a[p+j];
				a[p+j]=a[p+j-1];
				a[p+j-1]=x;
			}
		}
	}
}

void qsort(int p,int q,int isize){
    if(q-p+1>isize){
        int i,j,k,x,y;
		
        k=rand()%(q-p);
        x=a[p+k];
        a[p+k]=a[q];
        a[q]=x;
		
        for(i=0,j=0;p+i<q;i++){
            if(a[p+i]<x){
                y=a[p+i];
                a[p+i]=a[p+j];
                a[p+j]=y;
                j++;
            }
        }
		
        y=a[q];
        a[q]=a[p+j];
        a[p+j]=y;
		
		qsort(p,p+j-1,isize);
        qsort(p+j+1,q,isize);
    }
	
}

int main(){
    int i,n;
	
    srand((unsigned int)time(NULL));
	
    scanf("%d",&n);
    for(i=0;i<n;i++)scanf("%d",&a[i]);
	
    qsort(0,n-1,pow(n,1/2));
	isort(0,n-1);
	
    for(i=0;i<n;i++){
        printf("%d",a[i]);
        if(i==n-1)printf("\n"); else printf(" ");
    }
	
    return 0;
}

Compiler output:
main.c:22:6: error: conflicting types for 'qsort'; have 'void(int,  int,  int)'
   22 | void qsort(int p,int q,int isize){
      |      ^~~~~
In file included from main.c:3:
/usr/include/stdlib.h:970:13: note: previous declaration of 'qsort' with type 'void(void *, size_t,  size_t,  int (*)(const void *, const void *))' {aka 'void(void *, long unsigned int,  long unsigned int,  int (*)(const void *, const void *))'}
  970 | extern void qsort (void *__base, size_t __nmemb, size_t __size,
      |             ^~~~~
Language: C

#include<stdio.h>
 
int main( ) {
	int max_input;
	int input[1000];
	int i;
	int count = 0;
	int true_count = 0;
	bool loop = true;

	scanf("%d",& max_input);
	for( i = 0; i < max_input; i++) {
		scanf( "%d" ,&input[ i ] );
	}

	while( loop ){
		count ++;
		for( i = 0; i < max_input; i++) {
			if( input[ i ] == count ) {
				printf("%d " ,count);
				true_count++;
			}
		}
		if( true_count == max_input) {
			loop = false;
		}
	}

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:9: error: unknown type name 'bool'
    9 |         bool loop = true;
      |         ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include<stdio.h>
  +++ |+#include <stdbool.h>
    2 | 
main.c:9:21: error: 'true' undeclared (first use in this function)
    9 |         bool loop = true;
      |                     ^~~~
main.c:9:21: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:9:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:25:32: error: 'false' undeclared (first use in this function)
   25 |                         loop = false;
      |                                ^~~~~
main.c:25:32: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C

#include<stdio.h>
 
int main( ) {
	int max_input;
	int input[100];
	int i;
	int count = 0;
	int true_count = 0;
	bool loop = true;

	scanf("%d",& max_input);
	for( i = 0; i < max_input; i++) {
		scanf( "%d" ,&input[ i ] );
	}

	while( loop ){
		count ++;
		for( i = 0; i < max_input; i++) {
			if( input[ i ] == count ) {
				printf("%d " ,count);
				true_count++;
			}
		}
		if( true_count == max_input) {
			loop = false;
		}
	}

    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:9: error: unknown type name 'bool'
    9 |         bool loop = true;
      |         ^~~~
main.c:2:1: note: 'bool' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
    1 | #include<stdio.h>
  +++ |+#include <stdbool.h>
    2 | 
main.c:9:21: error: 'true' undeclared (first use in this function)
    9 |         bool loop = true;
      |                     ^~~~
main.c:9:21: note: 'true' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
main.c:9:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:25:32: error: 'false' undeclared (first use in this function)
   25 |                         loop = false;
      |                                ^~~~~
main.c:25:32: note: 'false' is defined in header '<stdbool.h>'; this is probably fixable by adding '#include <stdbool.h>'
Language: C

#include<stdio.h>
#include<stdlib.h>
#define MAX 1000000
int int_sort( const void * a , const void * b ) {
    return *( int * )a - *( int * )b;
}
int main(){
	int n;
	int num[MAX];
	int i;
	
	scanf("%d",&n);
	for(i=0;i<n;i++)scanf("%d",&num[i]);
	qsort(num,n,sizeof(int),int_sort);
	for(i=0;i<n-1;i++)printf("%d ",s[i]);printf("%d\n",s[i]);
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:15:40: error: 's' undeclared (first use in this function)
   15 |         for(i=0;i<n-1;i++)printf("%d ",s[i]);printf("%d\n",s[i]);
      |                                        ^
main.c:15:40: note: each undeclared identifier is reported only once for each function it appears in
Language: C

/*

与えられた配列の要素を昇順に並べ替えよ。

やり方：
	・プログラミング入門第十回の授業の配布資料、プログラム4を流用。

結果：正解。

*/

#include <stdio.h

int sort00(int data[],int n);
int minindex00(int data[],int from, int to);

int main()
{
	int i,n;
	int data[1000000];
	scanf("%d",&n);
	for(i=0; i<n; i++){
		scanf("%d",&data[i]);
	}
	sort00(data,n);
	for(i=0; i<n-1; i++){
		printf("%d ",data[i]);
	}
	printf("%d",data[i]);
	puts("");
	return 0;
}

int sort00(int data[],int n)
{
	int i,work,minindex;
	for(i=0;i<n;i++){
		minindex=minindex00(data,i,n);
		work=data[i];
		data[i]=data[minindex];
		data[minindex]=work;
	}
	return;
}

int minindex00(int data[], int from, int to)
{
	int i;
	int result=from;
	for(i=from;i<to;i++){
		if(data[result]>data[i]){
			result=i;
		}
	}
	return result;
}

Compiler output:
main.c:12:18: error: missing terminating > character
   12 | #include <stdio.h
      |                  ^
main.c: In function 'sort00':
main.c:43:9: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch]
   43 |         return;
      |         ^~~~~~
main.c:34:5: note: declared here
   34 | int sort00(int data[],int n)
      |     ^~~~~~
Language: C

n=gets.to_i
puts a=gets.split().map{|x| x.to_i}.sort

Compiler output:
main.c:1:1: warning: data definition has no type or storage class
    1 | n=gets.to_i
      | ^
main.c:1:1: error: type defaults to 'int' in declaration of 'n' [-Wimplicit-int]
main.c:1:3: error: 'gets' undeclared here (not in a function)
    1 | n=gets.to_i
      |   ^~~~
main.c:2:1: error: expected ',' or ';' before 'puts'
    2 | puts a=gets.split().map{|x| x.to_i}.sort
      | ^~~~
main.c:2:36: error: expected identifier or '(' before '.' token
    2 | puts a=gets.split().map{|x| x.to_i}.sort
      |                                    ^
Language: C

#include <stdio.h>

int main(void)
{
	int num[1000,005], num2[1000,005];
	char c[1000,005];
	int n, i, i2, j;
	
	scanf("%d", &n);
	
	
	for (i = 0; i < n; i++){
		scanf("%d", &num[i]);
		c[i] = 0;
	}
	
	for (i = 0; i < n; i++){
		j = -1;
		
		for (i2 = 0; i2 < n; i2++){
			
			if (c[i2] == 0 && (j == -1 || num[j] > num[i2])){
				j = i2;
			}
		}
		c[j] = 1;
		num2[i] = num[j];
	}
	
	for (i = 0; i < n; i++){
		
		printf("%d", num2[i]);
		
		if (i != n - 1){
			printf(" ");
		}
	}
	printf("\n");
	
	return (0);
}

Compiler output:
main.c: In function 'main':
main.c:5:21: error: expected ']' before ',' token
    5 |         int num[1000,005], num2[1000,005];
      |                     ^
      |                     ]
main.c:6:20: error: expected ']' before ',' token
    6 |         char c[1000,005];
      |                    ^
      |                    ]
main.c:13:30: error: 'num' undeclared (first use in this function)
   13 |                 scanf("%d", &num[i]);
      |                              ^~~
main.c:13:30: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:17: error: 'c' undeclared (first use in this function)
   14 |                 c[i] = 0;
      |                 ^
main.c:27:17: error: 'num2' undeclared (first use in this function)
   27 |                 num2[i] = num[j];
      |                 ^~~~
Language: C

バブルソートする関数　数字を小さいものから昇順に整理する関数
int bubble_sort(int x[],int n) //配列ｘがソートしたい配列、ｎはソートする配列の数
{
 int i,j,temp;
 for(i=0; i<n-1; i++){
     for(j=n-1; j>i; j--){
         if(x[j-1]>x[j]){     //前の要素のほうが大きかったら
            temp = x[j-1];
            x[j-1]=x[j];
            x[j]=temp;           //値を入れ替える。
            }
        }
 }
}  //実用性あり！
int main()
{
 int n,i;
 int s[1000000]={0};
 scanf("%d",&n);
 for(i=0; i<n; i++){
 scanf(%d ,&s[i]);
 }
 bubble_sort(s,n);
 for(i=0; i<n; i++){
 printf("%d ",s[i]);
 }
 putchar('\n');
return 0;
}

Compiler output:
main.c:1:21: error: stray '\343' in program
    1 | <U+30D0><U+30D6><U+30EB><U+30BD><U+30FC><U+30C8><U+3059><U+308B><U+95A2><U+6570><U+3000><U+6570><U+5B57><U+3092><U+5C0F><U+3055><U+3044><U+3082><U+306E><U+304B><U+3089><U+6607><U+9806><U+306B><U+6574><U+7406><U+3059><U+308B><U+95A2><U+6570>
      |                                                                                 ^~~~~~~~
main.c:1:1: error: unknown type name '\U000030d0\U000030d6\U000030eb\U000030bd\U000030fc\U000030c8\U00003059\U0000308b\U000095a2\U00006570'
    1 | バブルソートする関数　数字を小さいものから昇順に整理する関数
      | ^~~~~~~~~~~~~~~~~~~~
main.c:1:61: error: expected ';' before 'int'
    1 | バブルソートする関数　数字を小さいものから昇順に整理する関数
      |                                                             ^
      |                                                             ;
    2 | int bubble_sort(int x[],int n) //配列ｘがソートしたい配列、ｎはソートする配列の数
      | ~~~                                                          
main.c: In function 'main':
main.c:19:2: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
   19 |  scanf("%d",&n);
      |  ^~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'scanf'
  +++ |+#include <stdio.h>
    1 | バブルソートする関数　数字を小さいものから昇順に整理する関数
main.c:19:2: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
   19 |  scanf("%d",&n);
      |  ^~~~~
main.c:19:2: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:21:8: error: expected expression before '%' token
   21 |  scanf(%d ,&s[i]);
      |        ^
main.c:25:2: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   25 |  printf("%d ",s[i]);
      |  ^~~~~~
main.c:25:2: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:25:2: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:25:2: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:27:2: error: implicit declaration of function 'putchar' [-Wimplicit-function-declaration]
   27 |  putchar('\n');
      |  ^~~~~~~
main.c:27:2: note: include '<stdio.h>' or provide a declaration of 'putchar'
Language: C

M(a,b){return a-b;)
main(int *a,b,i)
{scanf("%d",b);a=malloc(4,b);
for(i=0;i<b;i++)scanf("%d",a[i]);
qsort(a,4*b,M);
for(i=0;i<b-1;i++)printf("%d ",a[i]);
printf("%d\n",a[b-1]);
return 0;
}

Compiler output:
main.c:1:1: error: return type defaults to 'int' [-Wimplicit-int]
    1 | M(a,b){return a-b;)
      | ^
main.c: In function 'M':
main.c:1:1: error: type of 'a' defaults to 'int' [-Wimplicit-int]
main.c:1:1: error: type of 'b' defaults to 'int' [-Wimplicit-int]
main.c:1:19: error: expected statement before ')' token
    1 | M(a,b){return a-b;)
      |                   ^
main.c:2:1: error: implicit declaration of function 'main' [-Wimplicit-function-declaration]
    2 | main(int *a,b,i)
      | ^~~~
main.c:2:6: error: expected expression before 'int'
    2 | main(int *a,b,i)
      |      ^~~
main.c:2:17: error: expected ';' before '{' token
    2 | main(int *a,b,i)
      |                 ^
      |                 ;
    3 | {scanf("%d",b);a=malloc(4,b);
      | ~                
main.c:9:1: error: expected declaration or statement at end of input
    9 | }
      | ^
Language: C

#include <stdio.h>

int a[10000];
int al[100000], ar[10000];

void mergeSort(int left, int right);
{
	int middle;
	int idxl, idxr, leftn;
	int i;
	int n;
	
	if(left == right){
		return ;
	}
	middle = (left + right) / 2;
	
	mergeSort(left, middle); //列の左側をマージソート//
	mergrSort(middle + 1, right); //列の右側をマージソート//
	
	n = right -left + 1;
	leftn = middle - left + 1;
	
	idxl = 0;
	for (i = left; i <= middle; i++){
		al[idxl++] = a[i];
	}
	indxr = 0;
	for (i = middle + 1; i <= right; i++){
		ar[idxr++] = a[i];
	}
	indxr = 0;
	indxl = 0;
	for (i = left; i <= right; i++){
		if(idxl == leftn || (index != n - leftn && al[idxl] <= ar[idxr])){
			a[i] = ar[idxr++];
		}
		else {
			a[i] = al[idxl++];
		}
	}
}
int main(void)
{
	int n;
	int i;
	
	scanf("%d", &n);
	
	for (i = 0; i < n; i++){
		scanf("%d", &a[i]);
	}
	mergeSort(0, n - 1);
	
	for (i = 0; i < n; i++){
		printf("%d", a[i]);
		if(i == n -1){
			printf("\n");
		}
		else {
			printf(" ");
		}
	}
	
	return (0);
}

Compiler output:
main.c:7:1: error: expected identifier or '(' before '{' token
    7 | {
      | ^
Language: C

#include <stdio.h>
#include <math.h>
#define PI 3.14159265358979323

int main(){

	int i,j,n,temp;
	int a[1,000,000];
	//FILE *fp;
	//fp = fopen("text.txt", "r");
	//fscanf(fp,"%s%*c",buf1);
	scanf("%d%*c",&n);
	for(i=0;i<n;i++)
		scanf("%d",a+i);
	for(i=0;i<n-1;i++)
		for(j=0;j<n-i-1;j++)
			if(a[j]>a[j+1]){
				temp=a[j];
				a[j]=a[j+1];
				a[j+1]=temp;
			}
	printf("%d",a[0]);
	for(i=1;i<n;i++)
		printf(" %d",a[i]);
	printf("\n");
	//for(i=0;i<=10000000000;i++);
	return 0;

Compiler output:
main.c: In function 'main':
main.c:8:16: error: expected ']' before ',' token
    8 |         int a[1,000,000];
      |                ^
      |                ]
main.c:14:28: error: 'a' undeclared (first use in this function)
   14 |                 scanf("%d",a+i);
      |                            ^
main.c:14:28: note: each undeclared identifier is reported only once for each function it appears in
main.c:27:9: error: expected declaration or statement at end of input
   27 |         return 0;
      |         ^~~~~~
Language: C

#include<stdio.h>
#define compile 0
void init(int array[], int length)
{
	int i = 0;
	for(i = 0; i < length; i++)
	{
		array[i] = 0;
	}
}
void output(int array[], int length)
{
	int i = 0;
	for(i = 0; i < length; i++)
	{
		if(i < length - 1)
		{
			printf("%d ", array[i]);
		}
		else
		{
			printf("%d\n", array[i]);
		}
	}
}
void merge(int separate1[], int length1, int separate2[], int length2, int array[])
{
	int i = 0, j = 0;
	while(i <= length1 && j <= length2)
	{
		if(/*(j >= length2)*/ ||(i < length1 && (separate1[i] < separate2[j])))
		{
			array[i + j] = separate1[i];
			i++;
		}
		else
		{
			array[i + j] = separate2[j];
			j++;
		}
		#if compile == 2
		output(array, length1 + length2);
		#endif
	}
}
void mergesort(int array[], int length)
{
	if(length > 1)
	{
		int m = length / 2;
		int n = length - m;
		int i = 0;
		int separate1[m];
		int separate2[n];
		init(separate1, m);
		init(separate2, n);
		#if compile == 1
		printf("separate1 = ");
		#endif
		for(i = 0; i < m; i++)
		{
			separate1[i] = array[i];
			#if compile == 1
			printf("%d ", separate1[i]);
			#endif
		}
		#if compile == 1
		puts("");
		printf("separate2 = ");
		#endif
		for(i = 0; i < n; i++)
		{
			separate2[i] = array[i + m];
			#if compile == 1
			printf("%d ", separate2[i]);
			#endif
		}
		#if compile == 1
		puts("");
		#endif
		mergesort(separate1, m);
		mergesort(separate2, n);
		merge(separate1, m, separate2, n, array);
	}
}
main()
{
	int length = 0, i = 0;
	scanf("%d", &length);
	
	int array[length];
	init(array, length);
	
	for(i = 0; i < length; i++)
	{
		scanf("%d", &array[i]);
	}
	
	mergesort(array, length);
	
	output(array, length);
	return 0;
}

Compiler output:
main.c: In function 'merge':
main.c:31:39: error: expected expression before '||' token
   31 |                 if(/*(j >= length2)*/ ||(i < length1 && (separate1[i] < separate2[j])))
      |                                       ^~
main.c: At top level:
main.c:86:1: error: return type defaults to 'int' [-Wimplicit-int]
   86 | main()
      | ^~~~
Language: C

#include<stdio.h>
#include<stdlib.h>
#define N 1000000
int sort(int const void*a,int const void*b)
{
    return (*(int*)a-*(int*)b);
}
int main(){
    int n,i;
    static int a[N];
    scanf("%d",n);
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
    }
    qsort(a,n,sizeof(int),sort);
    for(i=0;i<n;i++){
        printf("%d",a[i]);
    }
    printf("%d\n",a[n-1]);
    return 0;
}

Compiler output:
main.c:4:20: error: two or more data types in declaration specifiers
    4 | int sort(int const void*a,int const void*b)
      |                    ^~~~
main.c:4:37: error: two or more data types in declaration specifiers
    4 | int sort(int const void*a,int const void*b)
      |                                     ^~~~
main.c: In function 'main':
main.c:15:27: error: passing argument 4 of 'qsort' from incompatible pointer type [-Wincompatible-pointer-types]
   15 |     qsort(a,n,sizeof(int),sort);
      |                           ^~~~
      |                           |
      |                           int (*)(const int *, const int *)
In file included from main.c:2:
/usr/include/stdlib.h:971:34: note: expected '__compar_fn_t' {aka 'int (*)(const void *, const void *)'} but argument is of type 'int (*)(const int *, const int *)'
  971 |                    __compar_fn_t __compar) __nonnull ((1, 4));
      |                    ~~~~~~~~~~~~~~^~~~~~~~
Language: C

#include<stdio.h>
#include<stdlib.h>
#define N 1000000
int sort(int const void*a,int const void*b)
{
    return (*(int*)a-*(int*)b);
}
int main(){
    int n,i;
    static int a[N];
    scanf("%d",n);
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
    }
    qsort(a,n,sizeof(int),sort);
    for(i=0;i<n-1;i++){
        printf("%d ",a[i]);
    }
    printf("%d\n",a[n-1]);
    return 0;
}

Compiler output:
main.c:4:20: error: two or more data types in declaration specifiers
    4 | int sort(int const void*a,int const void*b)
      |                    ^~~~
main.c:4:37: error: two or more data types in declaration specifiers
    4 | int sort(int const void*a,int const void*b)
      |                                     ^~~~
main.c: In function 'main':
main.c:15:27: error: passing argument 4 of 'qsort' from incompatible pointer type [-Wincompatible-pointer-types]
   15 |     qsort(a,n,sizeof(int),sort);
      |                           ^~~~
      |                           |
      |                           int (*)(const int *, const int *)
In file included from main.c:2:
/usr/include/stdlib.h:971:34: note: expected '__compar_fn_t' {aka 'int (*)(const void *, const void *)'} but argument is of type 'int (*)(const int *, const int *)'
  971 |                    __compar_fn_t __compar) __nonnull ((1, 4));
      |                    ~~~~~~~~~~~~~~^~~~~~~~
Language: C++

include<stdio.h>
int main(void){

	int num[100], j, i, n, w;

	scanf_s("%d", &n);

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

	for (i = 0; i < n - 1; i++){
		for (j = i + 1; j < n; j++){
			if (num[i]>num[j]){
				w = num[i];
				num[i] = num[j];
				num[j] = w;
			}
		}

	}
	for (i = 0; i<n; i++)printf("%d ", num[i]);

	
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<stdio.h>
      | ^~~~~~~
Language: C++

#Include <iostream>
#include <Algorithm>
#include <vector>
int main(){
int a;
cin a;
vector<int> x;
for(int i = 0; i < a; i++){
     x.push_back(a);
}
sort(x.begin(),x.end());

for(int i  = 0; i < a; i++){
cout << vector[i] << ' ';
}

}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #Include; did you mean #include?
    1 | #Include <iostream>
      |  ^~~~~~~
      |  include
a.cc:2:10: fatal error: Algorithm: No such file or directory
    2 | #include <Algorithm>
      |          ^~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <vector>
using namespace std;
int main(void){
  int a,b;
  cin >> a;
  vector<int>c;
  for(int i = 0; i < a; i++){
	cin >> c[i];
  }
  sort(x.begin(),x.end());

  for(int i  = 0; i < a; i++){
	cout << c[i] << " ";
  }
  return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:8: error: 'x' was not declared in this scope
   11 |   sort(x.begin(),x.end());
      |        ^
a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |   sort(x.begin(),x.end());
      |   ^~~~
      |   short
Language: C++

#include <algorithm>
#include <iostream>
using namespace std;

int main() {
	int N=0;
	int a[2000000];
	cin >> N;
	for(int i=0; i<N; ++i) {
		cin >> a[i];
	}
	sort(a,A+N);
	for(int i=0; i<N-1; ++i) {
		cout << a[i] << ' ';
	}
	cout << a[N-1] << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: 'A' was not declared in this scope
   12 |         sort(a,A+N);
      |                ^
Language: C++

#include <iostream>
#include <algorithm>

int n;
int a[2000000];
int main() {
	cin >> n;
	for(int i=0; i<n; ++i) {
		cin >> a[i];
	}
	sort(a,a+n);
	for(int i=0; i<n-1; ++i) {
		cout << a[i] << " ";
	}
	cout << a[n-1];
}

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:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:11:9: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   11 |         sort(a,a+n);
      |         ^~~~
      |         std::sort
In file included from /usr/include/c++/14/algorithm:86,
                 from a.cc:2:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: 'std::sort' declared here
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
a.cc:13:17: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 |                 cout << a[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:15:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |         cout << a[n-1];
      |         ^~~~
      |         std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

#include <iostream>
#include <vector>
using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    for(int i;i<n;i++) cin >> a[i];
    sort(a.begin(),a.end());
    for(int i;i<n;i++){
        cout << a[i];
        if(i!=n-1)cout << " ";
    }
    cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   10 |     sort(a.begin(),a.end());
      |     ^~~~
      |     short
Language: C++

#include <cstdio>
#include <algorithm>
using namespace std;

int main()
{
    int n;
    int *array;

	scanf("%d", &n);
    array = new int[n];
	for (int i = 0; i < n; i++) scanf("%d", array + i);
    sort(array, array + n);
    cout << array[0];
	for (int i = 0; i < n; i++){
		printf("%d%c", array[i], " \n"[i == n - 1]);
	}
    delete[] array;

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:5: error: 'cout' was not declared in this scope
   14 |     cout << array[0];
      |     ^~~~
a.cc:3:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include <algorithm>
  +++ |+#include <iostream>
    3 | using namespace std;