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

#include<iostream>
#include<algorithm>

int num[1000000];
int n;

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    9 | 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:12:1: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   12 | sort(num,num+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:14:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   14 | cout << num[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:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 | cout << num[n-1] << 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:15:21: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   15 | cout << num[n-1] << 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 <iostream>
#include <algorithm>
using namespace std;

int main() {
int n;
cin>>n;
int a[1000010];
for(int k=0;k<n;k++){
cin>>a[k];
}
sort(a,a+n);
cout<<a[0]
for(int j=1;j<n;j++){
cout<<" "<<a[j];
}
cout<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:11: error: expected ';' before 'for'
   13 | cout<<a[0]
      |           ^
      |           ;
   14 | for(int j=1;j<n;j++){
      | ~~~        
a.cc:14:13: error: 'j' was not declared in this scope
   14 | for(int j=1;j<n;j++){
      |             ^
Language: C++

#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;
int main(){
    int n;
    scanf("%d",&n);
    vector<int> ns(n);
    for(int &x : ns) scanf("%d",&x);
    sort(begin(ns),end(ns));
    for(int i=0;i<n-1;i++) printf("%d ",x);
    if(n-1>=0) printf("%d\n",ns[n-1]);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:41: error: 'x' was not declared in this scope
   11 |     for(int i=0;i<n-1;i++) printf("%d ",x);
      |                                         ^
Language: Java

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


public class Main {

	@SuppressWarnings("unchecked")
	public static void main(String[] args) {
		
		Scanner sc=new Scanner(System.in);
		int N = sc.nextInt();
		int[] a = new int[N];
		int[] b = new int[N];
		for (int i = 0; i < a.length; i++) {
			int x = sc.nextInt();
						a[i]=x;
		}
		Arrays.sort(a);h
		StringBuffer sb=new StringBuffer();
		for (int i = 0; i < a.length; i++) {
			sb.append(" "+a[i]);
//			System.out.println(a[i]);
			
		}
		System.out.println(sb.toString().substring(1));
	}

}

Compiler output:
Main.java:19: error: ';' expected
		StringBuffer sb=new StringBuffer();
		            ^
1 error
Language: Java

import java.io.IOException;
import java.util.Scanner;
import java.util.Arrays;
public class SortI{
    public static void main(String[] args) throws IOException{
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(), i=0;
        int[] length = new int[n];
        for(; i<n; i++){
            length[i] = sc.nextInt();
        }

        Arrays.sort(length);
        i=0;
        while(true){
            System.out.print(length[i]);
            if(++i==n){
                System.out.print("\n");
                break;
            }
            else{
                System.out.print(" ");
            }
        }

        sc.close();
    }
}

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

import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = Integer.parseInt(scan.next());
		int[] val = new int[n];
		for( int i = 0; i < n; i++ ){
			val[i] = Integer.parseInt(scan.next());
		}
		for( int i = 0; i < n; i++ ){
			for( int j = 0; j < n - 1; j++ ){
				int count = 0;	//??\?????????????????°???
				if( val[j] > val[j+1] ){
					int temp = val[j];
					val[j] = val[j+1];
					val[j+1] = temp;
					count++;
				}
			}
			if( count == 0 ){
				//for???????????????
				i = n;
				j = n;
			}
		}
		
		System.out.print(val[0]);
		for( int i = 1; i < n; i++ ){
			System.out.print(" " + val[i]);
		}
		System.out.println();
		return;
	}
}

Compiler output:
Main.java:21: error: cannot find symbol
			if( count == 0 ){
			    ^
  symbol:   variable count
  location: class Main
Main.java:24: error: cannot find symbol
				j = n;
				^
  symbol:   variable j
  location: class Main
2 errors
Language: Java

import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] x = new int[n];
		int buf;
		for(int i = 0; i < n; i++)
			x[i] = sc.nextInt();
		for(int i = 0; i < n - 1; i++){
			for(int j = i + 1; j < n; j++){
				if(x[i] > x[j]){
					buf = x[i];
					x[i] = x[j];
					x[j] = buf;
				}
			}
		}
		for(int i = 0; i < n; i++)
			System.out.printf("%d ", x[i]);
		System.out.printf("\b\n");
	}

Compiler output:
Main.java:23: error: reached end of file while parsing
	}
	 ^
1 error
Language: Java

import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] x = new int[n];
		int buf;
		for(int i = 0; i < n; i++)
			x[i] = sc.nextInt();
		for(int i = 0; i < n - 1; i++){
			for(int j = i + 1; j < n; j++){
				if(x[i] > x[j]){
					buf = x[i];
					x[i] = x[j];
					x[j] = buf;
				}
			}
		}
		for(int i = 0; i < n; i++)
			System.out.printf("%d ", x[i]);
		System.out.printf("\b\n");
	}
???

Compiler output:
Main.java:24: error: illegal start of type
???
^
Main.java:24: error: reached end of file while parsing
???
   ^
2 errors
Language: Java

import java.util.Scanner;

public class sort1{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int a[];
		a = new int[n];
		for(int i = 0; i < n; i++){
			a[i] = sc.nextInt();
		}
		for(int i = 0; i < n; i++){
			for(int j = 1; j < n-i; j++){
				if(a[j-1] > a[j]){
					int c = a[j];
					a[j] = a[j-1];
					a[j-1] = c;
				}
			}
		}
		for(int i = 0; i < n; i++){
			System.out.printf("%d ", a[i]);
		}
	}
}

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

import java.util.Scanner;

public class AOJ10028 {
	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 < a.length; i++)
			a[i] = sc.nextInt();
		for (int i = 0; i < a.length - 1; i++)
			for (int j = i + 1; j < a.length; i++)
				if (a[i] > a[j]) {
					int k = a[i];
					a[i] = a[j];
					a[j] = k;
				}
		for (int i = 0; i < a.length - 1; i++)
			System.out.print(a[i] + " ");
		System.out.println();
	}
}

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

public class Main {
	public static void main(String[] args) throws Exception{
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] nums = new int[n];
		for(int i = 0; i < n; i++){
			nums[i] = sc.nextInt();
		}
		sc.close();
		for(int i = 0; i < n - 1; i++){
			for(int j = 0; j < n - i - 1; j++){
				if(nums[j] > nums[j + 1]){
					int tmp = nums[j];
					nums[j] = nums[j + 1];
					nums[j + 1] = tmp;
				}
			}
		}
		for(int num : nums){
			System.out.print(num + " ");
		}
		System.out.println();
	}
}

Compiler output:
Main.java:3: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		^
  symbol:   class Scanner
  location: class Main
Main.java:3: error: cannot find symbol
		Scanner sc = new Scanner(System.in);
		                 ^
  symbol:   class Scanner
  location: class Main
2 errors
Language: Java

import java.io.*;
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int[] array = new int[n];
    for (int i = 0; i < n; i++) {
      array[i] = Integer.parseInt(sc.next());
    }
    Arrays.stream(quickSort(array, 0, array.length-1)).forEach(
            e -> System.out.println(e));
  }
  public static int[] quickSort(int[] array, int left, int right) {
    if(left<=right) {
      int p = array[(left+right)/2];
      int l = left;
      int r = right;
      while(l <= r) {
        while(array[l] < p) l++;
        while(array[r] > p) r--;

        if(l <= r) {
          int tmp = array[l];
          array[l] = array[r];
          array[r] = tmp;
          l++;
          r--;
        }
      }

      quickSort(array, left, r);
      quickSort(array, l, right);
    }
    for (int i = 0; i < n; i++) {
      System.out.print(a[i] + " ");
    }
    System.out.print('\n');
  }
}

Compiler output:
Main.java:36: error: cannot find symbol
    for (int i = 0; i < n; i++) {
                        ^
  symbol:   variable n
  location: class Main
Main.java:37: error: cannot find symbol
      System.out.print(a[i] + " ");
                       ^
  symbol:   variable a
  location: class Main
2 errors
Language: Java

import java.io.*;
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int[] array = new int[n];
    for (int i = 0; i < n; i++) {
      array[i] = Integer.parseInt(sc.next());
    }
    quickSort(array, 0, array.length-1);
    for (int i = 0; i < n - 1; i++) {
      System.out.print(array[i] + " ");
    }
    System.out.println(array[i]);
  }
  public static int[] quickSort(int[] array, int left, int right) {
    if(left<=right) {
      int p = array[(left+right)/2];
      int l = left;
      int r = right;
      while(l <= r) {
        while(array[l] < p) l++;
        while(array[r] > p) r--;

        if(l <= r) {
          int tmp = array[l];
          array[l] = array[r];
          array[r] = tmp;
          l++;
          r--;
        }
      }

      quickSort(array, left, r);
      quickSort(array, l, right);
    }
    return array;
  }
}

Compiler output:
Main.java:16: error: cannot find symbol
    System.out.println(array[i]);
                             ^
  symbol:   variable i
  location: class Main
1 error
Language: Java

import java.io.*;
import java.util.*;

public class aoj10028{
	public static void main(String[] args){
		Scanner scan=new Scanner(System.in);
		try{
			int n=scan.nextInt();
			int temp;
			ArrayList<Integer> x=new ArrayList<Integer>();
			/*
			ArrayList ans=new ArrayList();
			ArrayList notUse=new ArrayList();
			int INF=100000000;
			int min;
			*/
			for(int i=0;i<n;i++){
				x.add(scan.nextInt());
				//notUse.add(true);
			}
			for(int i=0;i<n;i++){
				for(int j=i;j<n;j++){
					if(x.get(i)>x.get(j)){
						temp=x.get(i);
						x.set(i,x.get(j));
						x.set(j,temp);
					}
				}
			}
			for(int i=0;i<n-1;i++){
				System.out.print(x.get(i)+" ");
			}
			System.out.println(x.get(n-1));
		}catch(NumberFormatException e){
			System.out.println(e);
		}
	}
	/*
	private static int[] binarySort(int num[]){
		int left=0;
		int right=num.length;
		int center=right/2;
		int temp;
		while(left<right){
			while(num[left]<num[center]){
				left++;
			while(num[center]<num[right]){
				right--;
			}
			if(left<right){
				temp=num[left];
				num[left]=num[right];
				num[right]=temp;
			}
		}
		if(1<center){
			binarySort(num[])
	}
	*/
}

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

import java.util.Scanner;

//Try bubble sort!!
public class Main{
 public static void main(String[] args){
  Scanner sc=new Scanner(System.in);
  int n=sc.nextInt();
  int[] data =new int[1000];
  for(int j=0;j<n;j++){
   data[j]=sc.nextInt();
  }
for(int i=0;i<n-1;i++){
 for(int j=n-1;j>i;j--){
  if(data[j]<data[j-1]){
   int tmp=data[j];
   data[j]=data[j-1];
   data[j-1]=tmp;
   }
  }
  }

for(int k=0;k<n;k++){
 System.out.printf("%d",data[k]);
 if(k=n-1)
  System.out.printf(" ");
}
System.out.printf("\r");
  }
  }

Compiler output:
Main.java:24: error: incompatible types: int cannot be converted to boolean
 if(k=n-1)
     ^
1 error
Language: Java

import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int arr[] = new int[n];
    int wk;
    for (int i = 0; i < n; i++) {
      int arr[i] = sc.nextInt();
    }
    int h = n/1.3;
    while (true) {
      int swaps = 0;
      for (int i = 0; i+h < n; i++) {
        if (arr[i] > arr[i+h]) {
          wk = arr[i+h];
          arr[i+h] = arr[i];
          arr[i] = wk
          swaps++
        }
      if (h == 1) {
        if (swaps == 0) {
          break;
        }
      }
      else {
        h = h*10/13;
      }
    }
    for (int i = 0; i < n-1; i++) {
      System.out.print(arr[i] + " ");
    }
    System.out.println(arr[n]);
  }
}

Compiler output:
Main.java:9: error: ']' expected
      int arr[i] = sc.nextInt();
              ^
Main.java:9: error: ';' expected
      int arr[i] = sc.nextInt();
               ^
Main.java:18: error: ';' expected
          arr[i] = wk
                     ^
Main.java:19: error: ';' expected
          swaps++
                 ^
Main.java:35: error: reached end of file while parsing
}
 ^
5 errors
Language: Java

import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int arr[] = new int[n];
    int wk;
    for (int i = 0; i < n; i++) {
      arr[i] = sc.nextInt();
    }
    int h = n/1.3;
    while (true) {
      int swaps = 0;
      for (int i = 0; i+h < n; i++) {
        if (arr[i] > arr[i+h]) {
          wk = arr[i+h];
          arr[i+h] = arr[i];
          arr[i] = wk
          swaps++
        }
      if (h == 1) {
        if (swaps == 0) {
          break;
        }
      }
      else {
        h = h*10/13;
      }
    }
    for (int i = 0; i < n-1; i++) {
      System.out.print(arr[i] + " ");
    }
    System.out.println(arr[n]);
  }
}

Compiler output:
Main.java:18: error: ';' expected
          arr[i] = wk
                     ^
Main.java:19: error: ';' expected
          swaps++
                 ^
Main.java:35: error: reached end of file while parsing
}
 ^
3 errors
Language: Java

import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int arr[] = new int[n];
    int wk;
    for (int i = 0; i < n; i++) {
      arr[i] = sc.nextInt();
    }
    int h = n/1.3;
    while (true) {
      int swaps = 0;
      for (int i = 0; i+h < n; i++) {
        if (arr[i] > arr[i+h]) {
          wk = arr[i+h];
          arr[i+h] = arr[i];
          arr[i] = wk;
          swaps++;
        }
      if (h == 1) {
        if (swaps == 0) {
          break;
        }
      }
      else {
        h = h*10/13;
      }
    }
    for (int i = 0; i < n-1; i++) {
      System.out.print(arr[i] + " ");
    }
    System.out.println(arr[n]);
  }
}

Compiler output:
Main.java:35: error: reached end of file while parsing
}
 ^
1 error
Language: Java

import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int arr[] = new int[n];
    int wk;
    for (int i = 0; i < n; i++) {
      arr[i] = sc.nextInt();
    }
    int h = n/1.3;
    while (true) {
      int swaps = 0;
      for (int i = 0; i+h < n; i++) {
        if (arr[i] > arr[i+h]) {
          wk = arr[i+h];
          arr[i+h] = arr[i];
          arr[i] = wk;
          swaps++;
        }
        if (h == 1) {
          if (swaps == 0) {
            break;
          }
        }
        else {
          h = h*10/13;
        }
      }
      for (int i = 0; i < n-1; i++) {
        System.out.print(arr[i] + " ");
      }
      System.out.println(arr[n]);
    }
  }
}

Compiler output:
Main.java:11: error: incompatible types: possible lossy conversion from double to int
    int h = n/1.3;
             ^
1 error
Language: Java

import java.util.Scanner;
class Main{
  public static void quickSort(int[] arr, int pivot, int left, int right) {
    if (left <= right) {
      int pivot = arr[(left+right)/2];
      int l = left;
      int r = right;
      while (l <= r) {
        while (arr[l] < p) {
          l++;
        }
        while (arr[r] > p) {
          r--;
        }
        if (l < r) {
          int tmp = arr[l];
          arr[l] = arr[r];
          arr[r] = tmp;
          l++;
          r--;
        }
      }
      quickSort(arr, left, r);
      quickSort(arr, l, right);
    }
  }
  
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int arr[] = new int[n];
    for (int i = 0; i < n; i++) {
      arr[i] = sc.nextInt();
    }
    quickSort(arr, 0, n-1);
    for (int i = 0; i < n-1; i++) {
      System.out.print(arr[i] + " ");
    }
    System.out.println(arr[n-1]);
  }
}

Compiler output:
Main.java:5: error: variable pivot is already defined in method quickSort(int[],int,int,int)
      int pivot = arr[(left+right)/2];
          ^
Main.java:9: error: cannot find symbol
        while (arr[l] < p) {
                        ^
  symbol:   variable p
  location: class Main
Main.java:12: error: cannot find symbol
        while (arr[r] > p) {
                        ^
  symbol:   variable p
  location: class Main
Main.java:23: error: method quickSort in class Main cannot be applied to given types;
      quickSort(arr, left, r);
      ^
  required: int[],int,int,int
  found:    int[],int,int
  reason: actual and formal argument lists differ in length
Main.java:24: error: method quickSort in class Main cannot be applied to given types;
      quickSort(arr, l, right);
      ^
  required: int[],int,int,int
  found:    int[],int,int
  reason: actual and formal argument lists differ in length
Main.java:35: error: method quickSort in class Main cannot be applied to given types;
    quickSort(arr, 0, n-1);
    ^
  required: int[],int,int,int
  found:    int[],int,int
  reason: actual and formal argument lists differ in length
6 errors
Language: Java

import java.util.Scanner;
class Main{
  public static void quickSort(int[] arr, int pivot, int left, int right) {
    if (left <= right) {
      pivot = arr[(left+right)/2];
      int l = left;
      int r = right;
      while (l <= r) {
        while (arr[l] < pivot) {
          l++;
        }
        while (arr[r] > pivot) {
          r--;
        }
        if (l < r) {
          int tmp = arr[l];
          arr[l] = arr[r];
          arr[r] = tmp;
          l++;
          r--;
        }
      }
      quickSort(arr, left, r);
      quickSort(arr, l, right);
    }
  }
  
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int arr[] = new int[n];
    for (int i = 0; i < n; i++) {
      arr[i] = sc.nextInt();
    }
    quickSort(arr, 0, n-1);
    for (int i = 0; i < n-1; i++) {
      System.out.print(arr[i] + " ");
    }
    System.out.println(arr[n-1]);
  }
}

Compiler output:
Main.java:23: error: method quickSort in class Main cannot be applied to given types;
      quickSort(arr, left, r);
      ^
  required: int[],int,int,int
  found:    int[],int,int
  reason: actual and formal argument lists differ in length
Main.java:24: error: method quickSort in class Main cannot be applied to given types;
      quickSort(arr, l, right);
      ^
  required: int[],int,int,int
  found:    int[],int,int
  reason: actual and formal argument lists differ in length
Main.java:35: error: method quickSort in class Main cannot be applied to given types;
    quickSort(arr, 0, n-1);
    ^
  required: int[],int,int,int
  found:    int[],int,int
  reason: actual and formal argument lists differ in length
3 errors
Language: Java

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

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    ArrayList<Integer> list = new ArrayList<Integer>();
    int n = sc.nextInt();
    for (int i = 0; i < n; i++) {
      list.add(sc.nextInt());
    }
    quickSort(list, 0, n-1);
    for (int i = 0; i < n-1; i++) {
      System.out.print(list.get[i] + " ");
    }
    System.out.println(list.get[n-1]);
  }
  public static void quickSort(ArrayList<Integer> list, int left, int right) {
    if (left <= right) {
      int pivot = arr[(left+right)/2];
      int l = left;
      int r = right;
      while (l <= r) {
        while (list.get[l] < pivot) {
          l++;
        }
        while (list.get[r] > pivot) {
          r--;
        }
        if (l < r) {
          int tmp = list.get[l];
          list.set(l, list.get[r]);
          list.set(r, tmp);
          l++;
          r--;
        }
      }
      quickSort(list, left, r);
      quickSort(list, l, right);
    }
  }
  
}

Compiler output:
Main.java:14: error: cannot find symbol
      System.out.print(list.get[i] + " ");
                           ^
  symbol:   variable get
  location: variable list of type ArrayList<Integer>
Main.java:16: error: cannot find symbol
    System.out.println(list.get[n-1]);
                           ^
  symbol:   variable get
  location: variable list of type ArrayList<Integer>
Main.java:20: error: cannot find symbol
      int pivot = arr[(left+right)/2];
                  ^
  symbol:   variable arr
  location: class Main
Main.java:24: error: cannot find symbol
        while (list.get[l] < pivot) {
                   ^
  symbol:   variable get
  location: variable list of type ArrayList<Integer>
Main.java:27: error: cannot find symbol
        while (list.get[r] > pivot) {
                   ^
  symbol:   variable get
  location: variable list of type ArrayList<Integer>
Main.java:31: error: cannot find symbol
          int tmp = list.get[l];
                        ^
  symbol:   variable get
  location: variable list of type ArrayList<Integer>
Main.java:32: error: cannot find symbol
          list.set(l, list.get[r]);
                          ^
  symbol:   variable get
  location: variable list of type ArrayList<Integer>
7 errors
Language: Java

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

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    ArrayList<Integer> list = new ArrayList<Integer>();
    int n = sc.nextInt();
    for (int i = 0; i < n; i++) {
      list.add(sc.nextInt());
    }
    quickSort(list, 0, n-1);
    for (int i = 0; i < n-1; i++) {
      System.out.print(list.get[i] + " ");
    }
    System.out.println(list.get[n-1]);
  }
  public static void quickSort(ArrayList<Integer> list, int left, int right) {
    if (left <= right) {
      int pivot = list.get((left+right)/2);
      int l = left;
      int r = right;
      while (l <= r) {
        while (list.get[l] < pivot) {
          l++;
        }
        while (list.get[r] > pivot) {
          r--;
        }
        if (l < r) {
          int tmp = list.get[l];
          list.set(l, list.get[r]);
          list.set(r, tmp);
          l++;
          r--;
        }
      }
      quickSort(list, left, r);
      quickSort(list, l, right);
    }
  }
  
}

Compiler output:
Main.java:14: error: cannot find symbol
      System.out.print(list.get[i] + " ");
                           ^
  symbol:   variable get
  location: variable list of type ArrayList<Integer>
Main.java:16: error: cannot find symbol
    System.out.println(list.get[n-1]);
                           ^
  symbol:   variable get
  location: variable list of type ArrayList<Integer>
Main.java:24: error: cannot find symbol
        while (list.get[l] < pivot) {
                   ^
  symbol:   variable get
  location: variable list of type ArrayList<Integer>
Main.java:27: error: cannot find symbol
        while (list.get[r] > pivot) {
                   ^
  symbol:   variable get
  location: variable list of type ArrayList<Integer>
Main.java:31: error: cannot find symbol
          int tmp = list.get[l];
                        ^
  symbol:   variable get
  location: variable list of type ArrayList<Integer>
Main.java:32: error: cannot find symbol
          list.set(l, list.get[r]);
                          ^
  symbol:   variable get
  location: variable list of type ArrayList<Integer>
6 errors
Language: Java

import java.util.Scanner;
import java.util.Arrays;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int arr[] = new int[n];
    for (int i = 0; i < n; i++) {
      arr[i] = sc.nextInt();
    }
    Arrays.sort(arr);
    for (int i = 0; i < n-1; i++) {
      System.out.print(arr[i] + " ");
    }
    System.out.println(arr[n-1]);
  }
  }
  
}

Compiler output:
Main.java:19: error: class, interface, enum, or record expected
}
^
1 error
Language: Java

import java.util.Scanner;
public class Main {
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();
}
for (int k = 0; k < n; k++) {
for (int i = 1; i < n; i++) {
if (a[i-1] > a[i]) {
int buf = a[i-1];
a[i-1] = a[i];
a[i] = buf;
}
}
}
for (int i = 0; i < n; i++) {
System.out.print(a[i] = " ");
}
System.out.print("\b\n");
}
}

Compiler output:
Main.java:20: error: incompatible types: String cannot be converted to int
System.out.print(a[i] = " ");
                        ^
1 error
Language: Java

import java.io.*
class main{
 public static void main(String[] args)throws IOException{
	  BufferedReader br =new BufferedReader(new 
	  InputStreamReader(System.in));
	  int n=Integer.parseInt(br.readLine());
	  String[] who=new String[n];
	  who=br.readLine().split(" ");
	  int num[]=new int[n];
	  for(int i=0;i<n;i++){
	  	num[i]=Integer.parseInt(who[i]);
	  }
	  Arrays.sort(num);
	  for(int i=0;i<n;i++){
	  	System.out.println(num[i]);
	  }
}

Compiler output:
Main.java:1: error: ';' expected
import java.io.*
                ^
Main.java:17: error: reached end of file while parsing
}
 ^
2 errors
Language: Java

/* package whatever; // don't place package name! */

import java.util.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class main
{
	public static void main (String[] args) throws IOException
	{
	  BufferedReader br =new BufferedReader(new 
	  InputStreamReader(System.in));
	  int n=Integer.parseInt(br.readLine());
	  String[] who=new String[n];
	  who=br.readLine().split(" ");
	  int num[]=new int[n];
	  for(int i=0;i<n;i++){
	  	num[i]=Integer.parseInt(who[i]);
	  }
	  Arrays.sort(num);
	  for(int i=0;i<n-1;i++){
	  	System.out.print(num[i]+" ");
	  }
               System.out.println(num[i]);
 	}
}

Compiler output:
Main.java:24: error: cannot find symbol
               System.out.println(num[i]);
                                      ^
  symbol:   variable i
  location: class main
1 error
Language: Java

mport java.util.*;
public class Main {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int[] memo = new int[n];
        for(int i=0;i<n;i++)memo[i]=in.nextInt();
        Arrays.sort(memo);
        for(int s=0;s<n-1;s++)System.out.print(memo[s]+" ");
        System.out.println(memo[n-1]);
    }
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
mport java.util.*;
^
1 error
Language: Java

import java.io.*;
import java.util.*;

public class Main {
	public static void main(String args[]){
		ArrayList<Integer> input = new ArrayList<Integer>();
		ArrayList<Integer> output = new ArrayList<Integer>();
		int inputNumber=0;//n
		String inputString = null;//S
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		try {
			inputNumber = Integer.parseInt(br.readLine());
			inputString = br.readLine();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		input = StringToArrayList(inputString,inputNumber);
		output = Sorting(input,inputNumber);
		String outputString = "";
		for(int i=0;i<output.size();i++){
			if(i==output.size()-1){
				outputString +=output.get(i);
			}else{
				outputString += output.get(i)+ " ";
			}
		}
		System.out.println(outputString);
		//System.out.println(counter);
	}

	// convert type String to ArrayList
	private static ArrayList<Integer> StringToArrayList(String input, int number){
		ArrayList<Integer> output = new ArrayList<Integer>();
		StringTokenizer st = new StringTokenizer(input," ");// separated by Space
		for(int i=0;i<number;i++){
			output.add(Integer.parseInt(st.nextToken()));
		}
		return output;
	}
	//do sorting
	private static ArrayList<Integer> Sorting(ArrayList<Integer> input, int number){
		int separate1, separate2;
		ArrayList<Integer> tempList1 = new ArrayList<Integer>();
		ArrayList<Integer> tempList2 = new ArrayList<Integer>();
		ArrayList<Integer> newList1 = new ArrayList<Integer>();
		ArrayList<Integer> newList2 = new ArrayList<Integer>();
		if(number == 1){
			return input;
		}else if(number==2){
			if(input.get(0) > input.get(1)){
				int temp;
				temp = input.get(0);
				input.set(0,input.get(1));
				input.set(1,temp);
			}
			counter++;
			return input;
		}else{//number > 2
			if(number % 2==0){
				separate1 = number/2;
			}else{
				separate1 = number/2 ;
			}
			separate2 = number-separate1;
			for(int i=0;i<separate1;i++){
				tempList1.add(input.get(i));
			}
			for(int i=separate1;i<number;i++){
				tempList2.add(input.get(i));
			}
			newList1 = Sorting(tempList1,separate1);
			newList2 = Sorting(tempList2,separate2);
			int index=0;//index number of newList2
			for(int i=0;i<separate2;i++){// Extension for can't be used easily
				if(newList1.size()<index+1){
					newList1.add(index,newList2.get(i));
				}else if(newList2.get(i)<newList1.get(index)){
					newList1.add(index, newList2.get(i));
				}else{
					index++;
					i--;
				}
			}
			return newList1;
		}
	}
}

Compiler output:
Main.java:57: error: cannot find symbol
			counter++;
			^
  symbol:   variable counter
  location: class Main
1 error
Language: C

#include<iostream>
using namespace std;
int main(){
	int a[1000];
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	for(int i=0;i<n-1;i++){
		for(int j=i;j<n;j++){
			if(a[i]>a[j]){
				int tmp=a[i];
				a[i]=a[j];
				a[j]=tmp;
			}
		}
	}
	for(int i=0;i<n;i++){
		cout<<a[i];
		if(i!=n-1)
			cout<<" ";
	}
	cout<<endl;
}

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

100
0 3 3 2 9 0 8 2 6 6 9 1 1 3 5 8 3 0 6 9 2 7 7 2 8 0 3 9 2 4 9 1 7 0 4 5 0 4 0 2 4 3 1 0 6 6 1 9 7 5 1 0 4 4 5 9 0 7 6 3 4 4 0 9 0 6 2 2 3 0 9 9 5 5 9 7 9 7 4 6 9 6 4 3 5 7 6 9 4 2 5 3 8 1 0 0 7 5 6 3

Compiler output:
main.c:1:1: error: expected identifier or '(' before numeric constant
    1 | 100
      | ^~~
Language: C

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

#define LEN 15

__int64 count;

void bogo(int *array, int n)
{
	int i;
	int rand1;
	int rand2;
	int check;
	int swap;
	
	srand((unsigned) time(NULL));
	while (1){
		check = 0;
		for (i = 0; i < n - 1; i++){
			if (array[i] > array[i + 1]){
				check = 1;
				break;
			}
		}
		if (check == 0){
			break;
		}
		else{
			for (i = 0; i < n; i++){
				rand1 = rand() % LEN - 0;
				rand2 = rand() % LEN - 0;
				swap = array[rand1];
				array[rand1] = array[rand2];
				array[rand2] = swap;
				count++;
			}
			/*for (i = 0; i < n; i++){
				printf("%d ", array[i]);
			}
			printf("\n");*/
			if (count / LEN> 30000000000){
				printf("Error!\n");
				break;
			}
		}
	}
}
int main(void)
{
	int array[LEN];
	int i;
	
	srand((unsigned)time(NULL));
	
	for(i = 0; i < LEN; i++){
		array[i] = rand() % 10 + 0;
		//scanf("%d", &array[i]);
	}
	bogo(array, LEN);
	
	printf("%I64d\n", count / LEN);
	
	return 0;
}

Compiler output:
main.c:7:1: error: unknown type name '__int64'; did you mean '__int64_t'?
    7 | __int64 count;
      | ^~~~~~~
      | __int64_t
Language: C

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

#define MAX_DATA 1000

void bubble_sort(int x[MAX_DATA],int n);

void main(void){
	int n , i;
	int x[MAX_DATA];

	scanf_s("%d", &n);
	for (i = 0; i < n; i++){
		scanf_s("%d",&x[i]);
	}
	bubble_sort(x, n);

	printf("\n");

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

}

void bubble_sort(int x[MAX_DATA], int n)
{
	int c;
	int i, k;

	for (i = 0; i < n; i++){
		for (k = 0; k < n-1; k++){
			if (x[k] >= x[k + 1]){
				c = x[k];
				x[k] = x[k + 1];
				x[k + 1] = c;
			}
			else{}
		}
	}
}

Compiler output:
main.c: In function 'main':
main.c:12:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   12 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
Language: C

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

#define MAX_DATA 1000

void bubble_sort(int x[MAX_DATA],int n);

void main(void){
	int n , i;
	int x[MAX_DATA];

	scanf_s("%d", &n);
	for (i = 0; i < n; i++){
		scanf_s("%d",&x[i]);
	}
	bubble_sort(x, n);

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

}

void bubble_sort(int x[MAX_DATA], int n)
{
	int c;
	int i, k;

	for (i = 0; i < n; i++){
		for (k = 0; k < n-1; k++){
			if (x[k] >= x[k + 1]){
				c = x[k];
				x[k] = x[k + 1];
				x[k + 1] = c;
			}
			else{}
		}
	}
}

Compiler output:
main.c: In function 'main':
main.c:12:9: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   12 |         scanf_s("%d", &n);
      |         ^~~~~~~
      |         scanf
Language: C

#include <stdio.h>

#define MAX_DATA 1000

void bubble_sort(int x[MAX_DATA],int n);

void main(void){
	int n,i;
	int x[MAX_DATA];

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

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

}

void bubble_sort(int x[MAX_DATA], int n)
{
	int c;
	int i, k;

	for (i = 0; i < n; i++){
		for (k = 0; k < n-1; k++){
			if (x[k] >= x[k + 1]){
				c = x[k];
				x[k] = x[k + 1];
				x[k + 1] = c;
			}
			else{}
		}
	}
}

Compiler output:
main.c: In function 'main':
main.c:13:17: error: implicit declaration of function 'scanf_s'; did you mean 'scanf'? [-Wimplicit-function-declaration]
   13 |                 scanf_s("%d",&x[i]);
      |                 ^~~~~~~
      |                 scanf
Language: C

#include<stdio.h>

void Sort(int n,int **array){
	int i,j;
	for(i=0;i<n-1;i++){
		for(j=i+1;j<n;j++){
			if((*array)[i]>(*array)[j]){
				(*array)[i]+=(*array)[j];
				(*array)[j]=(*array)[i]-(*array)[j];
				(*array)[i]-=(*array)[j];
			 }
		 }
	}
 }

int main(){
	int i;
	int N;
	int arr[1000];
	int b;
	scanf(???%d???,&N);
	for(i=0;i<N;i++){
		scanf(???%d???,arr[i]);
	 }

	Sort(n,&arr);
	for(i=0;i<N-1;i++)printf(???%d ???,arr[i]);
	printf(???%d???,arr[i]);
	return 0;
 }

Compiler output:
main.c: In function 'main':
main.c:21:15: error: expected expression before '?' token
   21 |         scanf(???%d???,&N);
      |               ^
main.c:23:23: error: expected expression before '?' token
   23 |                 scanf(???%d???,arr[i]);
      |                       ^
main.c:26:14: error: 'n' undeclared (first use in this function)
   26 |         Sort(n,&arr);
      |              ^
main.c:26:14: note: each undeclared identifier is reported only once for each function it appears in
main.c:26:16: error: passing argument 2 of 'Sort' from incompatible pointer type [-Wincompatible-pointer-types]
   26 |         Sort(n,&arr);
      |                ^~~~
      |                |
      |                int (*)[1000]
main.c:3:23: note: expected 'int **' but argument is of type 'int (*)[1000]'
    3 | void Sort(int n,int **array){
      |                 ~~~~~~^~~~~
main.c:27:34: error: expected expression before '?' token
   27 |         for(i=0;i<N-1;i++)printf(???%d ???,arr[i]);
      |                                  ^
main.c:28:16: error: expected expression before '?' token
   28 |         printf(???%d???,arr[i]);
      |                ^
Language: C

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

int main(){
	int i,j,num,temp;
	int num[1000];

	scanf("%d",&num);

	for(i=0;i<num;i++){
		scanf("%d",&ans[i]);
	}
	for(i=1;i<num;i++){
		for(j=i;j>=0;j--){
			if(ans[j]<=ans[j-1]){
				temp=ans[j];
				ans[j]=ans[j-1];
				ans[j-1]=temp;
			}
		}
	}

	for(i=0;i<num;i++){
		printf("%d",ans[i]);
		if(i!=num-1)printf(" ");
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:13: error: conflicting types for 'num'; have 'int[1000]'
    6 |         int num[1000];
      |             ^~~
main.c:5:17: note: previous declaration of 'num' with type 'int'
    5 |         int i,j,num,temp;
      |                 ^~~
main.c:11:29: error: 'ans' undeclared (first use in this function); did you mean 'abs'?
   11 |                 scanf("%d",&ans[i]);
      |                             ^~~
      |                             abs
main.c:11:29: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>
int main(){
	int n,m[1000];
	int i,j;
	int num;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&m[i]);
		}
	for(i=0;i<n-1;i++){
		for(j=0;j<n-1-i;j++){
			if(m[j]>m[j+1]){
				num=m[j];
				m[j]=m[j+1];
				m[j+1]=num;
				}
			}
		}
	for(i=0;i<n;i++){
		printf("%d",m[i]);
		if(i!=n-1){
			printf(" ");
			}
		}
	printf("\n");
	return 0;
}#include<stdio.h>
int main(){
	int n,m[1000];
	int i,j;
	int num;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",m[i]);
		}
	for(i=0;i<n-1;i++){
		for(j=0;j<n-1-i;j++){
			if(m[j]>m[j+1]){
				num=m[j];
				m[j]=m[j+1];
				m[j+1]=num;
				}
			}
		}
	for(i=0;i<n;i++){
		printf("%d",m[i]);
		if(i!=n-1){
			printf(" ");
			}
		}
	printf("\n");
	return 0;
}

Compiler output:
main.c:27:2: error: stray '#' in program
   27 | }#include<stdio.h>
      |  ^
main.c:27:10: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   27 | }#include<stdio.h>
      |          ^
Language: C

#include<stdio.h>
int main(void)
{
	int data[n];
	int i,j,temp;
	scanf("%d",&n);
	n<=1000;
	for(i=0; i<n; i++)
	{
		printf("Data=");
		scanf("%d",&data[i]);
	}
	for(i=0; i<=n-1; i++)
	{
		for(j=n-1; j>=i+1; j--)
		{
			if(data[i]<data[j-1])
			{
				temp = data[j];
				data[j] = data[j-1];
				data[j-1] = temp;
			}
		}
	}
	for(i = 0; i<n; i++)
	{
		printf("Data[%2d] = %5d\n",i,data[i]);
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:18: error: 'n' undeclared (first use in this function)
    4 |         int data[n];
      |                  ^
main.c:4:18: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include<stdio.h>

int main() {
  int n[1000000], m, i, j, temp;

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

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

  for (i = 0; i < m; i += 1) {
    pirntf("%d ", n[i]);
  };
  primtf("\n");

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:22:5: error: implicit declaration of function 'pirntf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   22 |     pirntf("%d ", n[i]);
      |     ^~~~~~
      |     printf
main.c:24:3: error: implicit declaration of function 'primtf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   24 |   primtf("\n");
      |   ^~~~~~
      |   printf
Language: C

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

Compiler output:
main.c: In function 'main':
main.c:24:3: error: implicit declaration of function 'primtf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   24 |   primtf("\n");
      |   ^~~~~~
      |   printf
Language: C

#include<stdio.h>
    
int main() {
  int n[1000000], m, i, j, temp;
    
  scanf("%d", &m);
  for (i = 0; i < m; i += 1) {
    scanf("%d", &n[i]);
  }
    
  for (i = 0; i < m - 1; i += 1) {
    for (j = m - 1; j > i; j -= 1) {
      if (n[j] < n[j - 1]) {
        temp = n[j];
        n[j] = n[j - 1];
        n[j - 1] = temp;
      };
    };
  };
    
  for (i = 0; i < m; i += 1) {
    printf("%d ", n[i]);
    if (i == m - 1) {
      printf("\n");
      break;
    };
    pirntf(" ");
  };
  printf("\n");
    
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:27:5: error: implicit declaration of function 'pirntf'; did you mean 'printf'? [-Wimplicit-function-declaration]
   27 |     pirntf(" ");
      |     ^~~~~~
      |     printf
Language: C

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

#define N_MAX (10000)

int sort[N_MAX];
int buffer[N_MAX];

void MergeSort( int data[], int size )
{
	int i;
	int j;
	int k;
	int l;
	
	if( size <= 1 )return;
	
	i = 0;
	j = size/2;
	k = 0;
	
	MergeSort( data, size/2 );
	MergeSort( data+size/2, size-(size/2) );
	
	while( i < size/2 && j < size )
	{
		if( data[i] < data[j] )
		{
			buffer[k] = data[i];
			k++;
			i++;
		}
		else
		{
			buffer[k] = data[j];
			k++;
			j++;
		}
	}
	
	while( i < size/2 )
	{
		buffer[k] = data[i];
		k++;
		i++;
	}
	
	while( j < size )
	{
		buffer[k] = data[j];
		k++;
		j++;
	}
	
	for( l = 0; l < size; l++ )
	{
		data[l] = buffer[l];
	}
}
	

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

Compiler output:
main.c:4:10: fatal error: conio.h: No such file or directory
    4 | #include <conio.h>
      |          ^~~~~~~~~
compilation terminated.
Language: C

#include <stdio.h>

int main(void)
{
	int a[1001];
	int n;
	
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d ",a+i);
	}
	for(i=0;i<n/2;i++){
		for(j=i+1;j<n;j++){
			if(a[i]>a[j]){
				t=a[i];
				a[i]=a[j];
				a[j]=t;
			}
		}
	}
	
	for(i=0;i<n;i++){
		printf("%d ",a[i]);
	}
	
	printf("\n");
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:9:13: error: 'i' undeclared (first use in this function)
    9 |         for(i=0;i<n;i++){
      |             ^
main.c:9:13: note: each undeclared identifier is reported only once for each function it appears in
main.c:13:21: error: 'j' undeclared (first use in this function)
   13 |                 for(j=i+1;j<n;j++){
      |                     ^
main.c:15:33: error: 't' undeclared (first use in this function)
   15 |                                 t=a[i];
      |                                 ^
Language: C

#include <stdio.h>

int main(void)
{
	int num[1024], num2[1000];
	char c[1024];
	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:40:9: error: expected declaration or statement at end of input
   40 |         return (0);
      |         ^~~~~~
Language: C

#include <stdio.h>

int main(void)
{
	int n;
	int i, j;
	int a[1024];
	
	scanf("%d", &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]){ //降順にするときは不等号を逆に
				t = a[j];
				a[j + 1] = a[j];
				a[j] = t;
			}
		}
	}
	
	//これを降順にソートするにはどうすればよいか？
	
	for (i = 0; i < n; i++){
		printf("%d", a[i]);
		if (i == n - 1){
			printf("\n");
		}
		else {
			printf(" ");
		}
	}
	
	return (0);
}

Compiler output:
main.c: In function 'main':
main.c:18:33: error: 't' undeclared (first use in this function)
   18 |                                 t = a[j];
      |                                 ^
main.c:18:33: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main(void)
{
	int n;
	int i, j;
	int a[1024];
	
	scanf("%d", &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]){ //降順にするときは不等号を逆に
				t = a[j];
				a[j] = a[j + 1];
				a[j + 1] = t;
			}
		}
	}
	
	//これを降順にソートするにはどうすればよいか？
	
	for (i = 0; i < n; i++){
		printf("%d", a[i]);
		if (i == n - 1){
			printf("\n");
		}
		else {
			printf(" ");
		}
	}
	
	return (0);
}

Compiler output:
main.c: In function 'main':
main.c:18:33: error: 't' undeclared (first use in this function)
   18 |                                 t = a[j];
      |                                 ^
main.c:18:33: note: each undeclared identifier is reported only once for each function it appears in
Language: C

#include <stdio.h>

int main(void){
	int s[100000];
	int n, f, i, buf;
	
	scanf("%d", &n);
	
	for (f = 0; f < n; f++){
		scanf("%d", &s[f]);
	}
	
	for (f = 0; f < n; f++){
		for (i = 0; i != n; i++){
			if (s[i] > s[f]){
				buf = s[i];
				s[i] = s[f];
				s[f] = buf;
			}
		}
		
	}
	
	for (i = 0; i < n; i++){
		printf("%d ", &n[i]);
	}
	printf("\n");
	
	return (0);
}

Compiler output:
main.c: In function 'main':
main.c:25:33: error: subscripted value is neither array nor pointer nor vector
   25 |                 printf("%d ", &n[i]);
      |                                 ^
Language: C

#include <stdio.h>

int main(void){
	int s[1000000];
	int n, f, i, buf;
	
	scanf("%d", &n);
	
	for (f = 0; f < n; f++){
		scanf("%d", &s[f]);
	}
	
	for (f = 0; f < n; f++){
		for (i = 0; i != n; i++){
			if (s[i] > s[f]){
				buf = s[i];
				s[i] = s[f];
				s[f] = buf;
			}
		}
		
	}
	
	for (i = 0; i < n; i++){
		printf("%d ", &n[i]);
	}
	printf("\n");
	
	return (0);
}

Compiler output:
main.c: In function 'main':
main.c:25:33: error: subscripted value is neither array nor pointer nor vector
   25 |                 printf("%d ", &n[i]);
      |                                 ^
Language: C

#include<stdio.h>
int main()
{
	int n,tmp;
	int i,j;
	int x[1001];
	
	scanf("%d",&n);
	
	for(i=0;i<n;i++)
	    scanf("%d",&x[i]);
	
	for(i=0;i<n;i++){
		for(j=i;j<n;j++){
			if(x[i] < a[j]){
				tmp = x[i];
				x[j] = a[i];
				x[j] = tmp;
			}
		}
	}
	for(i=0;i<n;i++){
		printf("%d",x[i]);
		if(i)
			printf(" ");
	}
	printf("\n");
	
	return 0;
}		

Compiler output:
main.c: In function 'main':
main.c:15:35: error: 'a' undeclared (first use in this function)
   15 |                         if(x[i] < a[j]){
      |                                   ^
main.c:15:35: note: each undeclared identifier is reported only once for each function it appears in