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

#include<iostream>
using namespace std;
int main() {
	int N, L;
	cin >> N >> L;
	string A[N];
	for (int i = 0; i < N; i++) {
		cin >> A[N];
	}
	sort(A, A + N);
	for (int i = 0; i < N; i++) {
		cout << A[i];
		if (i = N - 1) {
			cout << endl;
		}
	}
}


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

#include<iostream>
#include<sort>
using namespace std;
int main() {
	int N, L;
	cin >> N >> L;
	string A[N];
	for (int i = 0; i < N; i++) {
		cin >> A[N];
	}
	sort(A, A + N);
	for (int i = 0; i < N; i++) {
		cout << A[i];
		if (i = N - 1) {
			cout << endl;
		}
	}
}


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

#include <iostream>

using namespace std;

int main()
{
    int N, L;
    string S[101];

    cin >> N >> L;

    for (int i = 0; i < N; i++)
        cin >> S[i];

    sort(S, S+N);

    for (int i = 0; i < N; i++)
        cout << S[i];

    cout << endl;

    return 0;
}

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

#include <stdio.h>
#include <string.h>

int main(void)
{
    int n, l, i, j, k, m;
    char s[100][100], tmp[100];
    scanf("%d %d", &n, &l);
    for (i = 0; i < n; i++)
    {
        scanf("%s", s[i]);
    }

    for (k = n - 1; k > 0; k--)
    {
        for (j = 0; j < k; j++)
        {
            for (i = 0; i < l; i++)
            {
                if (s[j][i] > s[j + 1][i]) {
                    for (m = 0; m < l; m++)
                    {
                        tmp[m] = s[j + 1][m];
                        s[j + 1][m] = s[j][m];
                        s[j][m] = tmp[m]
                    }
                    break;
                }
            }
        }
    }

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

    return 0;

}


Compiler output:
main.c: In function 'main':
main.c:25:41: error: expected ';' before '}' token
   25 |                         s[j][m] = tmp[m]
      |                                         ^
      |                                         ;
   26 |                     }
      |                     ~
Language: C++

#include<stdio.h>
#include<string.h>

int main(void){
    int n, l;
    scanf("%d%d", &n, &l);
    char s[n][l];
    for(int i=0;i<n;i++){
        scanf("%c", &s[i]);
    }
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            if(strcmp(s[j],s[j+1])>0){
                char a[];
                a[l]=s[j+1];
                s[j+1]=s[j];
                s[j]=a[l];
            }
        }
    }
    for(int i=0;i<n;i++){
        printf("%c", s[i]);
    }
    printf("\n");
}


Compiler output:
a.cc: In function 'int main()':
a.cc:14:22: error: storage size of 'a' isn't known
   14 |                 char a[];
      |                      ^
a.cc:16:23: error: invalid array assignment
   16 |                 s[j+1]=s[j];
      |                 ~~~~~~^~~~~
Language: C++

#include<stdio.h>
#include<string.h>

int main(void){
    int n, l;
    scanf("%d%d", &n, &l);
    char s[n][l];
    for(int i=0;i<n;i++){
        scanf("%d", &s[i]);
    }
    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            if(strcmp(s[j],s[j+1])>0){
                char a[l];
                a[l]=s[j+1];
                s[j+1]=s[j];
                s[j]=a[l];
            }
        }
    }
    for(int i=0;i<n;i++){
        printf("%d", s[i]);
    }
    printf("\n");
}


Compiler output:
a.cc: In function 'int main()':
a.cc:15:27: error: invalid conversion from 'char*' to 'char' [-fpermissive]
   15 |                 a[l]=s[j+1];
      |                      ~~~~~^
      |                           |
      |                           char*
a.cc:16:23: error: invalid array assignment
   16 |                 s[j+1]=s[j];
      |                 ~~~~~~^~~~~
a.cc:17:21: error: incompatible types in assignment of 'char' to 'char [l]'
   17 |                 s[j]=a[l];
      |                 ~~~~^~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int a,n,i;
string b[105];
int main()
{
    cin>>a>>n;
    for(i=0;i<a;i++)
    {
        cin>>b[s];
    }
    sort(b,b+a);
    for(i=0;i<a;i++)
    cout<<b[i];
    cout<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:16: error: 's' was not declared in this scope
   10 |         cin>>b[s];
      |                ^
Language: C++

#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main(int argc, char const *argv[]) {
  int n, l;
  cin >> n >> l;
  vector<string> s(n);
  for (size_t i = 0; i < n; i++) cin >> s[i];

  sort(s.begin(), s.end());
  string ans;
  for (size_t i = 0; i < n; i++) ans += s[i];

  cout << ans << endl;
  return 0;
}


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

#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int a,n;
char b[2333];
int main()
{
    cin>>a>>n;
    for(int s=0;s<a;s++)
        cin>>b[s];
    sort(b,b+a);
    for(int s=0;s<a;s++)
    cout<<b[s];
    cout<<endl
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:15: error: expected ';' before '}' token
   15 |     cout<<endl
      |               ^
      |               ;
   16 | }
      | ~
Language: C++

#include<iostream>
#include<cstdio>
using namespace std;
int a,n;
string b[105];
int main()
{
    cin>>a>>n;
    for(int s=0;s<a;s++)
    {
        cin>>b[s];
    }
    sort(b,b+a);
    for(int s=0;s<a;s++)
    cout<<b[s];
    cout<<endl;
}

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

#include <bits/stdc++.h>
using namespace std;

int main(){
  int n,m
  string s[100];
  cin>>n>>m;
  for(int i=0;i<n;i++){
    cin>>s[i];
  }
  sort(s,s+n);
  for(int i=0;i<n;i++){
    cout<<s[i];
  }
  cout<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'string'
    6 |   string s[100];
      |   ^~~~~~
a.cc:7:11: error: 'm' was not declared in this scope
    7 |   cin>>n>>m;
      |           ^
a.cc:9:10: error: 's' was not declared in this scope
    9 |     cin>>s[i];
      |          ^
a.cc:11:8: error: 's' was not declared in this scope
   11 |   sort(s,s+n);
      |        ^
Language: C++

#incldeu <bits/stdc++.h>
using namespace std;

int main(){
  int n,m
  string s[100];
  cin>>n>>m;
  for(int i=0;i<n;i++){
    cin>>s[i];
  }
  sort(s,s+n);
  for(int i=0;i<n;i++){
    cout<<s[i];
  }
  cout<<endl;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #incldeu; did you mean #include?
    1 | #incldeu <bits/stdc++.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'string'
    6 |   string s[100];
      |   ^~~~~~
a.cc:7:3: error: 'cin' was not declared in this scope
    7 |   cin>>n>>m;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #incldeu <bits/stdc++.h>
a.cc:7:11: error: 'm' was not declared in this scope
    7 |   cin>>n>>m;
      |           ^
a.cc:9:10: error: 's' was not declared in this scope
    9 |     cin>>s[i];
      |          ^
a.cc:11:8: error: 's' was not declared in this scope
   11 |   sort(s,s+n);
      |        ^
a.cc:11:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   11 |   sort(s,s+n);
      |   ^~~~
      |   short
a.cc:13:5: error: 'cout' was not declared in this scope
   13 |     cout<<s[i];
      |     ^~~~
a.cc:13:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:3: error: 'cout' was not declared in this scope
   15 |   cout<<endl;
      |   ^~~~
a.cc:15:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:15:9: error: 'endl' was not declared in this scope
   15 |   cout<<endl;
      |         ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #incldeu <bits/stdc++.h>
Language: Java

import java.util.*;
class Main{
 public static void main(String[] args){
  Scanner sc = new Scanner(System.in);
  int a=sc.nextInt(),b=nextInt();
  String c[] =new String[a];
  for(int i=0;i<b;i++){
   c[i]=sc.next();
  }
  Arrays.sort(c);
  for(int j=0;j<b;j++){
   System.out.print(c[i]);
  }
 }
}

Compiler output:
Main.java:5: error: cannot find symbol
  int a=sc.nextInt(),b=nextInt();
                       ^
  symbol:   method nextInt()
  location: class Main
Main.java:12: error: cannot find symbol
   System.out.print(c[i]);
                      ^
  symbol:   variable i
  location: class Main
2 errors
Language: C++

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

struct ap{
	int num;
	char ch[110];
};
bool cmp(ap a,ap b){
	return a.num<b.num;
}
ap a[110];
int main(){
	int n,l;
//	while(1){
		cin>>n>>l;getchar();
		for(int i=0;i<n;++i){
			gets(a[i].ch);
			a[i].num=0;
			int m=strlen(a[i].ch);
			for(int j=0;j<m;++j){
				a[i].num=a[i].num+a[i].ch[j]-'a';
			}
		}
		sort(a,a+n,cmp);
		for(int i=0;i<n;++i){
			cout<<(a[i].ch);
		}
		
//	}
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:25: error: 'gets' was not declared in this scope; did you mean 'getw'?
   19 |                         gets(a[i].ch);
      |                         ^~~~
      |                         getw
Language: C++

#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
int main ()
{

 char s[110][110],t[50];
 int n,i,j,k,l;
 while(scanf("%d%d\n",&n,&l)!=EOF)
 {

for(i=0;i<n;i++)
   gets(s[i]);
for(i=0;i<n-1;i++)
{
  k=i;
 for(j=i+1;j<n;j++)
 if(strcmp(s[j],s[k])<0)k=j;
 strcpy(t,s[i]); strcpy(s[i],s[k]); strcpy(s[k],t);
}
for(i=0;i<n;i++)
cout<<s[i];
printf("\n");
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:4: error: 'gets' was not declared in this scope; did you mean 'getw'?
   14 |    gets(s[i]);
      |    ^~~~
      |    getw
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 1000000000
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

int main(){
    cin.tie(0);
   	ios::sync_with_stdio(false);
  int N,L;
  cin >> N >> L;
  vector <string> v(N);
  
  for(int i = 0;i < N;i++) cin >> v[i];
  sort(vec.begin(),vec.end());
  
  for(int i = 0;i < N;i++) cout << v[i];
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:8: error: 'vec' was not declared in this scope
   28 |   sort(vec.begin(),vec.end());
      |        ^~~
Language: C++

#include<iostream>
#include<algorithm>

using namespace std;

int main(){
 int N,L;
 cin>>NL;
 char s[110];

 for(int i=0;i<N;i++)cin>>s[i];

 sort(s,s+N);

 for(int i=0;i<N;i++)cout<<s[i];

 cout<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:7: error: 'NL' was not declared in this scope; did you mean 'L'?
    8 |  cin>>NL;
      |       ^~
      |       L
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main()
{
	int l, n;
	cin >> n >> l;
	vactor<string> s(n);
	for (int i = 0; i < n; i++) cin >> s[i];
	
	sort(s.begin(), s.end());
	
	for (int i = 0; i < n; i++) cout << s[i];
	cout << endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:9: error: 'vactor' was not declared in this scope
    8 |         vactor<string> s(n);
      |         ^~~~~~
a.cc:8:22: error: expected primary-expression before '>' token
    8 |         vactor<string> s(n);
      |                      ^
a.cc:8:24: error: 's' was not declared in this scope
    8 |         vactor<string> s(n);
      |                        ^
Language: C++

n = list(map(int, input().split()))
a = []
for i in range(n[0]):
  a.append(input())

a.sort()

for i in range(n[0]):
  print(a[i], end="")
print()

Compiler output:
a.cc:1:1: error: 'n' does not name a type
    1 | n = list(map(int, input().split()))
      | ^
Language: C++

#include <bits/stdc++.h>
#define FOR(i,x,y) for(int i=x;i<y;i++)
using namespace std;
int main(){
  int N,L;
  cin >> N;
  vector<string> S(N);
  FOR(i,0,N)cin >> S[i];
  sort(S.begin(),S.end());
  for(auto x:S)cout << x;
  cout << endll
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:11: error: 'endll' was not declared in this scope
   11 |   cout << endll
      |           ^~~~~
Language: Java

public class Main {
	public static void main(String[] args) {
		Scanner sd = new Scanner(System.in);
		String s = sd.next();
		String t = sd.next();

		//行数
		int a = Integer.parseInt(s);
		//文字列の長さ
		int b = Integer.parseInt(t);
		//配列に入力
		String[] mozi = new String[a];
		for(int i=0; i<a; i++) {
			mozi[i] = sd.next();
		}

		for(int i=0; i<a-1; i++) {
			for(int j=0; j<a-1; j++) {
				String temp;
				if(mozi[i].compareTo(mozi[i+1])<0) {
					temp=mozi[i];
					mozi[i]=mozi[i+1];
					mozi[i+1]=temp;
				}else {
				}
			}
		}
		for(int i=0;i<a;i++) {
			System.out.print(mozi[i]);
		}
	}
}


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

#include<iostream>
#include<algorithm>
#include<math.h>
#include<cstdio>
#include<ctype.h>
#include<stdio.h>
#include<set>
#include<vector>
#include<map>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<numeric>
#include<string>
typedef long long ll;
using namespace std;
 
ll gcd(ll a, ll b){
if(a<b){return gcd(b,a);}
else if(a%b){return gcd(b,a%b);}
else{return b;}
}
int main(){
int N,L;
  cin>>N>>L;
  string S[150];
  string ans ="";
  for(int i=0; i<N; ++i)
  cin>>S[i];
  
  sort(S,S+N);

      ans+=S[i];
  
  cout<<ans<<endl;
}

  


Compiler output:
a.cc: In function 'int main()':
a.cc:35:14: error: 'i' was not declared in this scope
   35 |       ans+=S[i];
      |              ^
Language: C++

l = input().split(' ')

N = int(l[0])
L = int(l[1])
S=[]
for i in range(N):
    S.append(input())

S.sort()

for str in S:
    print(str,end="")

print()


Compiler output:
a.cc:1:1: error: 'l' does not name a type
    1 | l = input().split(' ')
      | ^
Language: C++

#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<queue>
#include<map>
using namespace std;
typedef long long LL;
#define M(a,b) memset(a,b,sizeof(a))
#define pb push_back
const int maxn = 200000+5;
string s[105];
int main()
{
    int n,l;
//    scanf("%d%d",&n,&l);
    cin>>n>>l;
    for (int i=1;i<=n;++i) {
        cin>>s[i];
    }
    sort(s+1,s+1+n);
    for (int i=1;i<=n;++i)
        cout<<s[i];
    cout<<'\n';
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:24:5: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   24 |     sort(s+1,s+1+n);
      |     ^~~~
      |     sqrt
Language: C++

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

int main()
{
  int n, l;
  cin >> n >> l;
  string s[110];
  for (int i = 0; i < n; i++) {
    cin >> s[i];
  }
  
  sort(s, s+n);
  string stot;
  for (int i = 0; i < n; i++) {
    stot += s[i];
  }
  cout << stot << endl
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:23: error: expected ';' before 'return'
   20 |   cout << stot << endl
      |                       ^
      |                       ;
   21 |   return 0;
      |   ~~~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main(){
int n,l;
cin>>n>>l;
string t;
vector<string>s(n);
for(int i=0;i<n;i++){
  cin>>s.at(i);
  }
sort(s.begin(),s.end());
for(int i=0;i<n;i++){
  t+=s.at(i)
  }
  cout<<t<<endl;
return 0;
}
 

Compiler output:
a.cc: In function 'int main()':
a.cc:14:13: error: expected ';' before '}' token
   14 |   t+=s.at(i)
      |             ^
      |             ;
   15 |   }
      |   ~
Language: C++

#include<bits/stdc++.h>
using namespace std;

int main(){
	int n,l;
  	cin >> n >> l;
  	vector<string> s(n); 
  	for (int i=0;i<n;i++){
    	cin >> s[i];
    }
  	sort(s.begin(),s.end())
  	for (int i=0;i<n;i++){
    	cin >> s[i];
    } 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:32: error: expected ';' before 'for'
   11 |         sort(s.begin(),s.end())
      |                                ^
      |                                ;
   12 |         for (int i=0;i<n;i++){
      |         ~~~                     
a.cc:12:22: error: 'i' was not declared in this scope
   12 |         for (int i=0;i<n;i++){
      |                      ^
Language: C++

#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

int main() {
  int N, L;
  vector<string> sv;
  
  for(int i = 0; i < N; i++) {
    string tmp;
    cin >> tmp;
    sv.push_back(tmp);
  }
  sort(sv.begin(), sv.end());
  
  for(int i = 0, svsize = sv.size(); i < svsize; i++) {
    cout << sv[i] << flush;
  }
  cout << endl;
  
  return 0;
}
  

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'vector' was not declared in this scope
    9 |   vector<string> sv;
      |   ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include <algorithm>
  +++ |+#include <vector>
    4 | 
a.cc:9:16: error: expected primary-expression before '>' token
    9 |   vector<string> sv;
      |                ^
a.cc:9:18: error: 'sv' was not declared in this scope
    9 |   vector<string> sv;
      |                  ^~
Language: C++

#include<iostream>
#include<cmath>
#include<vector>
#include<map>

using namespace std;

int main(){

	int N;
	int L;

	cin >> N >> L;

    vector<string> vec(N);

	for(int i = 0;i < N;i++){
	   cin  >>	vec.at(i);
	}

    sort(vec.begin(),vec.end());

    for(int i = 0;i < N;i++){
    	cout << vec.at(i);
    }


    return 0;

}


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

#include<vector>
#include<iostream>
#include<cmath>
#include<map>

using namespace std;

int main(){

	int N;
	int L;

	cin >> N >> L;

    vector<string> vec(N);

	for(int i = 0;i < N;i++){
	   cin  >>	vec.at(i);
	}

    sort(vec.begin(),vec.end());

    for(int i = 0;i < N;i++){
    	cout << vec.at(i);
    }


    return 0;

}


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

#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;
int ter(char *a,char *b)
{
 	return  strcmp(a,b);
}
int main()
{
	int n,l;
	char a[110][110];
	char s[110][110];
	cin>>n>>l;
	getchar();
	char b[110];
	for(int i=0;i<n;i++)
	{
		gets(a[i]);
	}
	for(int i=0;i<n;i++)
		for(int j=i+1;j<n;j++)
		{
			char c[110];
			if(ter(a[i],a[j])>-1)
			{
				strcpy(c,a[i]);
				strcpy(a[i],a[j]);
				strcpy(a[j],c);
			}
		}			
	for(int i=0;i<n;i++)
		cout<<a[i];
	cout<<endl; 
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:17: error: 'gets' was not declared in this scope; did you mean 'getw'?
   19 |                 gets(a[i]);
      |                 ^~~~
      |                 getw
Language: C

#include <stdio.h>
#include <string.h>

int main() {
  int n,l;
  int i,j = 0;
  char input[100][101];
  char temp[100];

  scanf("%d %d", &n, &l);

  for(i = 0; i < n; i++){
    scanf("%s", input[i]);
    // printf("%s", input[i]);
  }

  for(j = 0;j < n; j++){
    for(i = 0; i < n-1; i++){
      // if(input[i] > input[i+1]){
      if(strcmp(input[i], input[i+1]) > 0){
        flag = 1;
        strcpy(temp, input[i+1]);
        strcpy(input[i+1], input[i]);
        strcpy(input[i], temp);
      }
    }
  }
  
  for(i = 0; i <= n;i++){
    printf("%s", input[i]);
  }

  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:21:9: error: 'flag' undeclared (first use in this function)
   21 |         flag = 1;
      |         ^~~~
main.c:21:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main(){
        int n,k;
        cin>>n>>l;
        string s[100];
        string ans;
        for(int i=0;i<n;i++){
                cin>>s[i];
        }
        sort(s,s+n);
        for(int i=0;i<n;i++){
                ans=ans+s[i];
        }
        cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:17: error: 'l' was not declared in this scope
    7 |         cin>>n>>l;
      |                 ^
Language: Java

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


public class IrohaLovStr{
	public static void main(String[] args)
	{
		Scanner sc =new Scanner(System.in);
		int n=sc.nextInt();
		int l=sc.nextInt();
		String str[]=new String[l];
		String all;

		for(int i=0;i<n;i++)
		{
			//文字列読み取り
			str[i]=sc.next();
		}

		Arrays.sort(str);
		for (int i=0;i<n;i++) {
			System.out.print(str[i]);
		}
		System.out.println();
	}
} 

Compiler output:
Main.java:6: error: class IrohaLovStr is public, should be declared in a file named IrohaLovStr.java
public class IrohaLovStr{
       ^
1 error
Language: C++

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

string s[200];
int ans;

int main() {
	int n, l;
	cin >> n >> l;
	for (int i = 0; i < n; i++) {
		cin >> s[i];
	}
	sort(s, s + n);
	for (int i = 0; i < n; i++)ans += s[i];
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:40: error: no match for 'operator+=' (operand types are 'int' and 'std::string' {aka 'std::__cxx11::basic_string<char>'})
   16 |         for (int i = 0; i < n; i++)ans += s[i];
      |                                    ~~~~^~~~~~~
Language: Java

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

public class Beg42ProbB {
  static int MOD = 1000000007;
  static double EPS = 1e-9;

  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st = new StringTokenizer(in.readLine());

    int N = Integer.parseInt(st.nextToken());
    int L = Integer.parseInt(st.nextToken());

    String[] s = new String[N];

    for (int i = 0; i < N; i++) {
      s[i] = in.readLine();
    }
    Arrays.sort(s);

    String res = "";

    for (int i = 0; i < N; i++) {
      res += s[i];
    }

    System.out.println(res);

    in.close();
  }
}

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

#include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;
vector<string> s;
int main()
{
  int n, l;
  scanf("%d %d", &n, &l);
  for(int i=0;i<n;i++)
  {
    string a;
    scanf("%s", a);
    s.push_back(a);
  }
  sort(s.begin, s.end());
  for(int i=0;i<n;i++)
  {
  	printf("%s", s[i]);
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:7: error: no matching function for call to 'sort(<unresolved overloaded function type>, std::vector<std::__cxx11::basic_string<char> >::iterator)'
   17 |   sort(s.begin, s.end());
      |   ~~~~^~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:4762:5: note: candidate: 'void std::sort(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<__cxx11::basic_string<char>*, vector<__cxx11::basic_string<char> > >]'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4762:32: note:   no known conversion for argument 1 from '<unresolved overloaded function type>' to '__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char>*, std::vector<std::__cxx11::basic_string<char> > >'
 4762 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |          ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note: candidate: 'template<class _RAIter, class _Compare> void std::sort(_RAIter, _RAIter, _Compare)'
 4793 |     sort(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~
/usr/include/c++/14/bits/stl_algo.h:4793:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:86:
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator, class _Compare> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator, _Compare)'
  292 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:292:1: note:   candidate expects 4 arguments, 2 provided
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note: candidate: 'template<class _ExecutionPolicy, class _RandomAccessIterator> __pstl::__internal::__enable_if_execution_policy<_ExecutionPolicy, void> std::sort(_ExecutionPolicy&&, _RandomAccessIterator, _RandomAccessIterator)'
  296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
      | ^~~~
/usr/include/c++/14/pstl/glue_algorithm_defs.h:296:1: note:   candidate expects 3 arguments, 2 provided
Language: C++

#include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
std::vector<string> s;
int main()
{
  int n, l;
  scanf("%d %d", &n, &l);
  for(int i=0;i<n;i++)
  {
    std::string a;
    scanf("%s", a);
    s.std::push_back(a);
  }
  std::sort(s.std::begin, s.std::end());
  for(int i=0;i<n;i++)
  {
  	printf("%s", s[i]);
  }
}

Compiler output:
a.cc:5:13: error: 'string' was not declared in this scope
    5 | std::vector<string> s;
      |             ^~~~~~
a.cc:5:13: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from a.cc:4:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:5:19: error: template argument 1 is invalid
    5 | std::vector<string> s;
      |                   ^
a.cc:5:19: error: template argument 2 is invalid
a.cc: In function 'int main()':
a.cc:14:7: error: 'std::push_back' is not a class member
   14 |     s.std::push_back(a);
      |       ^~~
a.cc:16:15: error: 'std::begin' is not a class member
   16 |   std::sort(s.std::begin, s.std::end());
      |               ^~~
a.cc:16:29: error: 'std::end' is not a class member
   16 |   std::sort(s.std::begin, s.std::end());
      |                             ^~~
a.cc:19:23: error: invalid types 'int[int]' for array subscript
   19 |         printf("%s", s[i]);
      |                       ^
Language: C++

#include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
std::vector<string> s;
int main()
{
  int n, l;
  scanf("%d %d", &n, &l);
  for(int i=0;i<n;i++)
  {
    std::string a;
    scanf("%s", a);
    s.push_back(a);
  }
  sort(s.begin, s.end());
  for(int i=0;i<n;i++)
  {
  	printf("%s", s[i]);
  }
}

Compiler output:
a.cc:5:13: error: 'string' was not declared in this scope
    5 | std::vector<string> s;
      |             ^~~~~~
a.cc:5:13: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from a.cc:4:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:5:19: error: template argument 1 is invalid
    5 | std::vector<string> s;
      |                   ^
a.cc:5:19: error: template argument 2 is invalid
a.cc: In function 'int main()':
a.cc:14:7: error: request for member 'push_back' in 's', which is of non-class type 'int'
   14 |     s.push_back(a);
      |       ^~~~~~~~~
a.cc:16:10: error: request for member 'begin' in 's', which is of non-class type 'int'
   16 |   sort(s.begin, s.end());
      |          ^~~~~
a.cc:16:19: error: request for member 'end' in 's', which is of non-class type 'int'
   16 |   sort(s.begin, s.end());
      |                   ^~~
a.cc:16:3: error: 'sort' was not declared in this scope; did you mean 'std::sort'?
   16 |   sort(s.begin, s.end());
      |   ^~~~
      |   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:19:23: error: invalid types 'int[int]' for array subscript
   19 |         printf("%s", s[i]);
      |                       ^
Language: C++

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

int main(){
    int n,l;
    cin>>n>>l;
    vector<string> s;
    for(int i=0;i<n;i++){
        string str;
        cin>>str;
        s.push_back(str);
    }
    sort(s.begin(),s.end());
    string ans("");
    for(int i=0;i<n;i++){
        ans+=s[i];
    }
    cout<<ans;
}


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

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

int main(){
    int n,l;
    cin>>n>>l;
    vector<string> s;
    for(int i=0;i<n;i++){
        string str;
        cin>>str;
        s.push_back(str);
    }
    sort(s.begin(),s.end());
    string ans("");
    for(int i=0;i<n;i++){
        ans+=s[i];
    }
    cout<<ans<<endl;
}


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

#include <iostream>
#include <vector>

using namespace std;

int main() {
    int N, L;
    string tmp;
    vector<string> vector1;
    cin >> N >> L;
    for (int i = 0; i < N; ++i) {
        cin >> tmp;
        vector1.push_back(tmp);
    }
    sort(vector1.begin(), vector1.end());
    for (int j = 0; j < vector1.size(); ++j) {
        cout << vector1[j];
    }
    return 0;
}

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

# main関数
if __name__ == '__main__':

    n, l = map(int,input().split())
    a = []
    for i in range(n) :
        a.append(input())

    a.sort()

    for i in range(n) :
        print(a[i], end="")

    print()

Compiler output:
a.cc:1:3: error: invalid preprocessing directive #main\U000095a2\U00006570
    1 | # main関数
      |   ^~~~~~~~
a.cc:2:16: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
    2 | if __name__ == '__main__':
      |                ^~~~~~~~~~
a.cc:2:1: error: expected unqualified-id before 'if'
    2 | if __name__ == '__main__':
      | ^~
Language: C++

#include<iostream>
#include<cstring>
#include<string>
using namespace std;

int main(){
  int n,l;
  string s[111];
  
  cin >> n >> l;
  
  for(int i=0;i<n;i++){
    cin >> s[i];
  }
  
  sort(s,s+n);
  
  for(int i=0;i<n;i++){
    cout << s[i];
    if(i+1==n){
      cout << endl;
    }
  }

  return 0;
}
  


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

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

int main(){
  int n,l;
  string s[111];
  
  cin >> n >> l;
  
  for(int i=0;i<n;i++){
    cin >> s[i];
  }
  
  sort(s,s+n);
  
  for(int i=0;i<n;i++){
    cout << s[i];
    if(i+1==n){
      cout << endl;
    }
  }

  return 0;
}
  


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

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

vector<string> sort_s(vector<string> s, int begin, int end, int index);

vector<string> sort_s(vector<string> s, int begin, int end, int index){
    for(int i = begin; i < end; i++){
        for(int j = i; j < end; j++){
            if(s[i][index] > s[j][index]){
                buf = s[j];
                s[j] = s[i];
                s[i] = buf;
            }
        }
    }
    char match ;
    int count = 0;
    for(int i = begin; i < end; i++){
        if(s[i][index] == match){
            count++;
            if(count!=0 && i == end - 1){
                if(++index < s[i].length()){
                    //cout << i -count << i + 1 << index;
                    s = sort_s(s, i - count , i + 1, index );
                }
                count = 0;
            }
        }else{
            if(count!=0){
                if(++index < s[i].length()){
                    //cout << i -count << i + 1 << index;
                    s = sort_s(s, i - count - 1 , i , index );
                }
                
                count = 0;
            }
            match = s[i][index];
        }
    }

    return s;
}

int main(){
    int n,l;
    cin >> n >> l;
    vector<string> s(n,"");
    vector<int> a(n,0);
    for(int i = 0; i < n; i++){
        cin >> s[i];
        a[i] = i;
    }  
    s = sort_s(s, 0, n, 0);
    
    for(int i = 0; i < n; i++){
        cout << s[i];
    }
    cout << endl;
}

Compiler output:
a.cc: In function 'std::vector<std::__cxx11::basic_string<char> > sort_s(std::vector<std::__cxx11::basic_string<char> >, int, int, int)':
a.cc:12:17: error: 'buf' was not declared in this scope
   12 |                 buf = s[j];
      |                 ^~~
Language: C++

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

vector<string> sort_s(vector<string> s, int begin, int end, int index);

vector<string> sort_s(vector<string> s, int begin, int end, int index){
    for(int i = begin; i < end; i++){
        for(int j = i; j < end; j++){
            if(s[i][index] > s[j][index]){
                buf = s[j];
                s[j] = s[i];
                s[i] = buf;
            }
        }
    }
    char match ;
    int count = 0;
    for(int i = begin; i < end; i++){
        if(s[i][index] == match){
            count++;
            if(count!=0 && i == end - 1){
                if(++index < s[i].length()){
                    s = sort_s(s, i - count , i + 1, index );
                }
                count = 0;
            }
        }else{
            if(count!=0){
                if(++index < s[i].length()){
                    s = sort_s(s, i - count , i + 1, index );
                }
                
                count = 0;
            }
            match = s[i][index];
        }
    }

    return s;
}

int main(){
    int n,l;
    cin >> n >> l;
    vector<string> s(n,"");
    vector<int> a(n,0);
    for(int i = 0; i < n; i++){
        cin >> s[i];
        a[i] = i;
    }  
    s = sort_s(s, 0, n, 0);
    
    for(int i = 0; i < n; i++){
        cout << s[i];
    }
    cout << endl;
}

Compiler output:
a.cc: In function 'std::vector<std::__cxx11::basic_string<char> > sort_s(std::vector<std::__cxx11::basic_string<char> >, int, int, int)':
a.cc:12:17: error: 'buf' was not declared in this scope
   12 |                 buf = s[j];
      |                 ^~~
Language: C++

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

struct Str {
	char str[105];
}str[100];

int cmp(const void *a, const void *b) {
	const struct Str *p1 = (const struct Str*)a;
	const struct Str *p2 = (const struct Str*)b;
	return strcmp(p1->str, p2->str);

}

int main() {
	int n, l;
	cin >> n >> l;
	getchar();
	for (int i = 0; i < n; i++) gets(str[i].str);
	qsort(str, n, sizeof(Str), cmp);
	for (int i = 0; i < n; i++) printf("%s",str[i].str);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:37: error: 'gets' was not declared in this scope; did you mean 'getw'?
   22 |         for (int i = 0; i < n; i++) gets(str[i].str);
      |                                     ^~~~
      |                                     getw
Language: C++

#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cstdio>
using namespace std;

struct Str {
	char str[105];
}str[100];

int cmp(const void *a, const void *b) {
	const struct Str *p1 = (const struct Str*)a;
	const struct Str *p2 = (const struct Str*)b;
	return strcmp(p1->str, p2->str);

}

int main() {
	int n, l;
	cin >> n >> l;
	getchar();
	for (int i = 0; i < n; i++) gets(str[i].str);
	qsort(str, n, sizeof(Str), cmp);
	for (int i = 0; i < n; i++) printf("%s",str[i].str);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:22:37: error: 'gets' was not declared in this scope; did you mean 'getw'?
   22 |         for (int i = 0; i < n; i++) gets(str[i].str);
      |                                     ^~~~
      |                                     getw
Language: C

#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cstdio>
using namespace std;

struct Str {
	char str[105];
}str[100];

int cmp(const void *a, const void *b) {
	const struct Str *p1 = (const struct Str*)a;
	const struct Str *p2 = (const struct Str*)b;
	return strcmp(p1->str, p2->str);

}

int main() {
	int n, l;
	cin >> n >> l;
	getchar();
	for (int i = 0; i < n; i++) gets(str[i].str);
	qsort(str, n, sizeof(Str), cmp);
	for (int i = 0; i < n; i++) printf("%s",str[i].str);
	return 0;
}


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

#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cstdio>
using namespace std;

struct Str {
	char str[105];
}str[100];

int cmp(const void *a, const void *b) {
	const struct Str *p1 = (const struct Str*)a;
	const struct Str *p2 = (const struct Str*)b;
	return strcmp(p1->str, p2->str);

}

int main() {
	int n, l;
	cin >> n >> l;
	getchar();
	for (int i = 0; i < n; i++) gets(str[i].str);
	qsort(str, n, sizeof(Str), cmp);
	for (int i = 0; i < n; i++) printf("%s",str[i].str);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:37: error: 'gets' was not declared in this scope; did you mean 'getw'?
   22 |         for (int i = 0; i < n; i++) gets(str[i].str);
      |                                     ^~~~
      |                                     getw
Language: C++

#include <iostream>
#include <cstdlib>
#include <cstring>
using namespace std;

struct Str {
	char str[105];
}str[100];

int cmp(const void *a, const void *b) {
	const struct Str *p1 = (const struct Str*)a;
	const struct Str *p2 = (const struct Str*)b;
	return strcmp(p1->str, p2->str);

}

int main() {
	int n, l;
	cin >> n >> l;
	getchar();
	for (int i = 0; i < n; i++) gets(str[i].str);
	qsort(str, n, sizeof(Str), cmp);
	for (int i = 0; i < n; i++) printf("%s",str[i].str);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:37: error: 'gets' was not declared in this scope; did you mean 'getw'?
   21 |         for (int i = 0; i < n; i++) gets(str[i].str);
      |                                     ^~~~
      |                                     getw
Language: C++

#include <iostream>
#include <cstdlib>
#include <cstring>
using namespace std;

struct Str {
	char str[105];
}str[100];

int cmp(const void *a, const void *b) {
	const struct Str *p1 = (const struct Str*)a;
	const struct Str *p2 = (const struct Str*)b;
	return strcmp(p1->str, p2->str);

}

int main() {
	int n, l;
	cin >> n >> l;
	getchar();
	for (int i = 0; i < n; i++) gets_s(str[i].str);
	qsort(str, n, sizeof(Str), cmp);
	for (int i = 0; i < n; i++) printf("%s",str[i].str);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:37: error: 'gets_s' was not declared in this scope
   21 |         for (int i = 0; i < n; i++) gets_s(str[i].str);
      |                                     ^~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back

typedef long long ll;

const ll mod = 1000000007;
const double pi = 3.1415926535897932384626;

ll powmod(ll a, ll b) {ll res = 1; ll rem = a % mod; for (; b; b >>= 1) {if (b & 1) res = (res * rem) % mod; rem = (rem * rem) % mod;} return res;}

const int N = 108;

char hey[N];
string ara[N];

int main()
{
   // freopen("in", "r", stdin);
    //freopen("out", "w", stdout);
    
    int n = 0;
    int l = 0;
    scanf("%d %d\n", &n, &l);

    for (int i = 1; i <= n; ++i) {
	gets(hey);
	ara[i] = string(hey);
    }

    sort(ara + 1, ara + n + 1);

    for (int i = 1; i <= n; ++i) {
	printf("%s", ara[i].c_str());
    }

    puts("");

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:9: error: 'gets' was not declared in this scope; did you mean 'getw'?
   33 |         gets(hey);
      |         ^~~~
      |         getw
Language: C++

#include <bits/stdc++.h>
using namespace std;

int main()
{
int n,l,i;
cin>>n>>l;
vector<string > v(n);
for(i=0;i<n;i++)
cin>>v[i];
sort(v.begin(),v.end());
string s='''';
for(i=0;i<n;i++)
s+=v[i];
cout<<s<<endl;

return 0;
}

Compiler output:
a.cc:12:10: error: empty character constant
   12 | string s='''';
      |          ^~
a.cc:12:12: error: empty character constant
   12 | string s='''';
      |            ^~
a.cc: In function 'int main()':
a.cc:12:10: error: conversion from 'char' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   12 | string s='''';
      |          ^~
a.cc:12:12: error: expected ',' or ';' before '\x0'
   12 | string s='''';
      |            ^~
Language: C++

#include<iostream>
#include <string>
#include <iomanip>
#include <vector>
#include <queue>
#include <math.h>
#include <algorithm>
#include <functional>
#include <set> 
#include <map> 

using namespace std;
#define int long long
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) for (int i=0;i<(n);i++)

signed main()
{
	int n, l;
	cin >> n >> l;
	vector<string> str(n);
	string tmp;
	FOR(i, 1, n) FOR(j, 1, n) {
		if (str[j - 1] > str[j]) { swap(str[j - 1], str[j]); }
	}
	REP(i, n) {
		cout << str[i];
	}
	cout << endl;


Compiler output:
a.cc: In function 'int main()':
a.cc:29:22: error: expected '}' at end of input
   29 |         cout << endl;
      |                      ^
a.cc:18:1: note: to match this '{'
   18 | {
      | ^
Language: C++

#define _USE_MATH_DEFINES
#include <iostream>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <cmath>
#include <algorithm>
using namespace std;

int main() {
	int n, l;
	char s[100][100], tmp[100] = {};
	cin >> n >> l;
	for (int i = 0; i < n; i++) cin >> s[i];
	for (int i = 0; i < n - 1; i++)
		for (int j = 0; j < n - 1; j++)
			for (int k = 0; k < l - 1; k++) {
				if (s[j][k] > s[j + 1][k]) {
					strcpy(tmp, s[j]);
					strcpy(s[j], s[j + 1]);
					strcpy(s[j + 1], tmp);
					break;
				}
			}
	for (int i = 0; i < n; i++)
		cout << s[i] << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:41: error: 'strcpy' was not declared in this scope
   19 |                                         strcpy(tmp, s[j]);
      |                                         ^~~~~~
a.cc:8:1: note: 'strcpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    7 | #include <algorithm>
  +++ |+#include <cstring>
    8 | using namespace std;
Language: C++

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

int main(){
	int n,l;
	cin>>n>>l;
	set<string> s;
	for(int i = 0;i<n;i++){
		string a;
		cin>>a;
		s.insert(a);
	}
	
	for(auto x : s){
		cout<< x <<;
	}
	cout<<endl;
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:28: error: expected primary-expression before ';' token
   17 |                 cout<< x <<;
      |                            ^
Language: C++

    #include<iostream>
    #include<vector>
    #include<string>
#include<algorithm>
     
    using namespace std;
     
    int main()
    {
    int n, k; cin>>n>>k;
    string names[121];
    string temp;
    for(int i = 0; i<n; i++)
    {
    cin>>names[i];
    }
     
    sort(names, names+n);
     
    for(int i=0; i<n; i++) cout<<names[i];
    cout<<endl;
    return 0;
     

Compiler output:
a.cc: In function 'int main()':
a.cc:22:14: error: expected '}' at end of input
   22 |     return 0;
      |              ^
a.cc:9:5: note: to match this '{'
    9 |     {
      |     ^
Language: C++

    #include<iostream>
    #include<vector>
    #include<string>
     
    using namespace std;
     
    int main()
    {
    int n, k; cin>>n>>k;
    string names[121];
    string temp;
    for(int i = 0; i<n; i++)
    {
    cin>>names[i];
    }
     
    sort(names, names+n);
     
    for(int i=0; i<n; i++) cout<<names[i];
    cout<<endl;
    return 0;
     
    }

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

#include<iostream>
#include<vector>
#include<string>

using namespace std;

int main()
{
int n, k; cin>>n>>k;
string[121] names;
string temp;
for(int i = 0; i<n; i++)
{
cin>>names[i];
}

sort(names, names+n);

for(int i=0; i<n; i++) cout<<names[i];
cout<<endl;
return 0;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:8: error: expected identifier before numeric constant
   10 | string[121] names;
      |        ^~~
a.cc:10:8: error: expected ']' before numeric constant
   10 | string[121] names;
      |        ^~~
      |        ]
a.cc:10:7: error: structured binding declaration cannot have type 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   10 | string[121] names;
      |       ^
a.cc:10:7: note: type must be cv-qualified 'auto' or reference to cv-qualified 'auto'
a.cc:10:7: error: empty structured binding declaration
a.cc:10:13: error: expected initializer before 'names'
   10 | string[121] names;
      |             ^~~~~
a.cc:14:6: error: 'names' was not declared in this scope
   14 | cin>>names[i];
      |      ^~~~~
a.cc:17:6: error: 'names' was not declared in this scope
   17 | sort(names, names+n);
      |      ^~~~~
a.cc:17:1: error: 'sort' was not declared in this scope; did you mean 'short'?
   17 | sort(names, names+n);
      | ^~~~
      | short