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

#include <iostream>

#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;

int A[6];
int main() {
    rep(i, 6) cin >> A[i];
    sort(A, A + 4);
    sort(A + 4, A + 6);
    int ans = 0;
    rep(i, 3) ans += A[i + 1];
    ans += A[5];
    cout << ans << endl;
    return 0;
}

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

#include <stdio.h>
#include <string.h>
#include <algorithm>
using namespace std;
int main(){
	int A, B, C, D, E, F;
	scanf("%d%d%d%d%d%d", &A, &B, &C, &D, &E, &F);
	printf("%d\n", A + B + C + D + E + F - min(min(A, B), min(C, D)) - min(E, F);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:85: error: expected ')' before ';' token
    8 |         printf("%d\n", A + B + C + D + E + F - min(min(A, B), min(C, D)) - min(E, F);
      |               ~                                                                     ^
      |                                                                                     )
Language: C++

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

using namespace std;

int main()
{
	int sum = 0;
	int a[4], b[2];

	for (int i = 0; i < 4; i++)
	{
		scanf("%d", &a[i]);
	}
	for (int i = 0; i < 2; i++)
	{
		scanf("%d", &b[i]);
	}
	sort(rbegin(a), rend(a));
	sum = max(b[0], b[1]);
	for (int i = 0; i < 3; i++)
	{
		sum += a[i];
	}

	printf("%d\n", sum);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:14: error: 'rbegin' was not declared in this scope
   19 |         sort(rbegin(a), rend(a));
      |              ^~~~~~
a.cc:19:25: error: 'rend' was not declared in this scope; did you mean 'rand'?
   19 |         sort(rbegin(a), rend(a));
      |                         ^~~~
      |                         rand
Language: C++

#include<algorithm>
#include<iostream>

int main(){
	int s[4];
	int m_max;
	int h[3];
	int h_max;
	for(int i = 0;i<4;i++){
		cin>>s[i];
		m_max += s[i];
	}
	m_max -= (min(s[0],min(s[1],min(s[2],s[3]))));
	for(int i = 0;i<3;i++){
		cin>>h[i];
		h_max+=h[i];
	}
	h_max -= (min(h[0],min(h[1],h[2])));
	m_max += h_max;
	cout<<m_max<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:17: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   10 |                 cin>>s[i];
      |                 ^~~
      |                 std::cin
In file included from a.cc:2:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:13:37: error: 'min' was not declared in this scope; did you mean 'std::min'?
   13 |         m_max -= (min(s[0],min(s[1],min(s[2],s[3]))));
      |                                     ^~~
      |                                     std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:13:28: error: 'min' was not declared in this scope; did you mean 'std::min'?
   13 |         m_max -= (min(s[0],min(s[1],min(s[2],s[3]))));
      |                            ^~~
      |                            std::min
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:13:19: error: 'min' was not declared in this scope; did you mean 'std::min'?
   13 |         m_max -= (min(s[0],min(s[1],min(s[2],s[3]))));
      |                   ^~~
      |                   std::min
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:15:17: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   15 |                 cin>>h[i];
      |                 ^~~
      |                 std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:20:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   20 |         cout<<m_max<<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:20:22: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   20 |         cout<<m_max<<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<math.h>
#include<stdio.h>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<functional>

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


int main(){
	int a[4];int b[2];
	FOR(i,4){cin>>a[i];}
	FOR(i,2){cin>>b[i];}
	sort(a,a+4,greater<int>());
	sort(b,b+2,greater<int>());
	cout<<a[0]+a[1]+b[0}<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:9: error: 'sort' was not declared in this scope; did you mean 'sqrt'?
   18 |         sort(a,a+4,greater<int>());
      |         ^~~~
      |         sqrt
a.cc:20:28: error: expected ']' before '}' token
   20 |         cout<<a[0]+a[1]+b[0}<<endl;
      |                            ^
      |                            ]
a.cc:20:28: error: expected ';' before '}' token
   20 |         cout<<a[0]+a[1]+b[0}<<endl;
      |                            ^
      |                            ;
a.cc: At global scope:
a.cc:20:29: error: expected unqualified-id before '<<' token
   20 |         cout<<a[0]+a[1]+b[0}<<endl;
      |                             ^~
a.cc:21:1: error: expected declaration before '}' token
   21 | }
      | ^
Language: C++

#include<iostream>
#include <algorithm>
#include<math.h>
#include<stdio.h>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<functional>

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


int main(){
	int a[4];int b[2];
	FOR(i,4){cin>>a[i];}
	FOR(i,2){cin>>b[i];}
	sort(a,a+4,greater<int>());
	sort(b,b+2,greater<int>());
	cout<<a[0]+a[1]+b[0}<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:28: error: expected ']' before '}' token
   21 |         cout<<a[0]+a[1]+b[0}<<endl;
      |                            ^
      |                            ]
a.cc:21:28: error: expected ';' before '}' token
   21 |         cout<<a[0]+a[1]+b[0}<<endl;
      |                            ^
      |                            ;
a.cc: At global scope:
a.cc:21:29: error: expected unqualified-id before '<<' token
   21 |         cout<<a[0]+a[1]+b[0}<<endl;
      |                             ^~
a.cc:22:1: error: expected declaration before '}' token
   22 | }
      | ^
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:6:11: error: 'i' was not declared in this scope
    6 |         r(i,6)cin>>a[i];
      |           ^
a.cc:2:20: note: in definition of macro 'r'
    2 | #define r(i,n) for(i=0;i<n;i++)
      |                    ^
a.cc:9:11: error: 'i' was not declared in this scope
    9 |         r(i,6)if(i>1)s+=a[i];
      |           ^
a.cc:2:20: note: in definition of macro 'r'
    2 | #define r(i,n) for(i=0;i<n;i++)
      |                    ^
Language: C++

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

int main(){
    int a,b,c,d,e,f;
    cin >>a>>b>>c>>d>>e>>f;
    score[]={a,b,c,d};
    sort(score.begin(),score.end())
    score2[]={e,f};
    sort(score2.begin(),score2.end())
    cout <<score[1]+score[2]+score[3]+score2[1]<<endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'score' was not declared in this scope
    8 |     score[]={a,b,c,d};
      |     ^~~~~
a.cc:8:11: error: expected primary-expression before ']' token
    8 |     score[]={a,b,c,d};
      |           ^
a.cc:11:10: error: 'score2' was not declared in this scope
   11 |     sort(score2.begin(),score2.end())
      |          ^~~~~~
Language: C++

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

int main(){
    int a,b,c,d,e,f;
    cin >>a>>b>>c>>d>>e>>f;
    score[]={a,b,c,d};
    sort(score,score+4)
    score2[]={e,f};
    sort(score2,score2+2)
    cout <<score[1]+score[2]+score[3]+score2[1]<<endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'score' was not declared in this scope
    8 |     score[]={a,b,c,d};
      |     ^~~~~
a.cc:8:11: error: expected primary-expression before ']' token
    8 |     score[]={a,b,c,d};
      |           ^
a.cc:11:10: error: 'score2' was not declared in this scope
   11 |     sort(score2,score2+2)
      |          ^~~~~~
Language: C++

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

int main(){
    int a,b,c,d,e,f;
    cin >>a>>b>>c>>d>>e>>f;
    score[]={a,b,c,d};
    sort(score,score+4);
    score2[]={e,f};
    sort(score2,score2+2);
    cout <<score[1]+score[2]+score[3]+score2[1]<<endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'score' was not declared in this scope
    8 |     score[]={a,b,c,d};
      |     ^~~~~
a.cc:8:11: error: expected primary-expression before ']' token
    8 |     score[]={a,b,c,d};
      |           ^
a.cc:10:5: error: 'score2' was not declared in this scope
   10 |     score2[]={e,f};
      |     ^~~~~~
a.cc:10:12: error: expected primary-expression before ']' token
   10 |     score2[]={e,f};
      |            ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int a[4],b[2];
    for(int i=0;i<4;i++){
        cin>>a[i];
    }
    for(int i=0;i<2;i++){
        cin>>b[i];
    }
    for(int i=0;i<3;i++){
        for(int j=0;j<4;j++){
            if(a[j]<a[j+1]){
                swap(a[j],a[j+1]);
            }
        }
    }
    if(b[1]<b[2]){
        swap(b[1],b[2]);
    }
    cout<<a[0]+a[2]+a[3]+a[1]]+b[1]<<endl;
        return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:30: error: expected ';' before ']' token
   21 |     cout<<a[0]+a[2]+a[3]+a[1]]+b[1]<<endl;
      |                              ^
      |                              ;
Language: C++

// ?????±???????????????????????? 2015-1
#include<cstdio>
#include<algorithm>
using namespace std;
 
 
int main(){
  int a[4],b[2];
  for(int i=0;i<4;i++) scanf("%d",a+i);
  for(int i=0;i<2;i++) scanf("%d",b+i);
  sort(a,a+4);
  sort(b,b+2);
  int ans = 0;
  for(int i=3;i>0;i--) ans+=a[i];
  ans+=b[1];
  printf("%d\n",ans);
  return 0
}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:11: error: expected ';' before '}' token
   17 |   return 0
      |           ^
      |           ;
   18 | }
      | ~
Language: C++

#include<cstdio>
#include<algorithm>
using namespace std;
 
 
int main(){
  int a[4],b[2];
  for(int i=0;i<4;i++) scanf("%d",a+i);
  for(int i=0;i<2;i++) scanf("%d",b+i);
  sort(a,a+4);
  sort(b,b+2);
  int ans = 0;
  for(int i=3;i>0;i--) ans+=a[i];
  ans+=b[1];
  printf("%d\n",ans);
  return 0
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:11: error: expected ';' before '}' token
   16 |   return 0
      |           ^
      |           ;
   17 | }
      | ~
Language: C++

#include<iostream>
using namespace std;

int i, sumrika, sumsha, t, u, cnt=0;
int rika[5], sha[3];
int main(){
	int minrika=110, minsha=110;
	for(i=1; i<=4; i++){
	  cin>>rika[i]; sumrika+=rika[i];
	  it(rika[i]<minrika) {minrika=rika[i];}
	}
	for(i=1; i<=2; i++){
		cin>>sha[i]; sumsha+=sha[i];
		if(sha[i]<minsha) {minsha=sha[i];}
	}
	int disp = (sumrika-minrika)+(sumsha-minsha);
	cout << disp << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:11: error: 'it' was not declared in this scope; did you mean 't'?
   10 |           it(rika[i]<minrika) {minrika=rika[i];}
      |           ^~
      |           t
Language: C++

include<iostream>
using namespace std;
int main()
{
int a,b,c,d,e,f;
cin>>a>>b>>c>>d>>e>>f;
if(a>b)
{if(b>c){sum1=a+b}
else{sum2=a+c}
}
if(b>a)
{if(a>c){sum1=b+a}
else{sum1=b+c}
}
if(c>a)
{if(a>b){sum1=c+a}
else{sum1=c+b}
}
if(e>f){sum2=e}
else{sum2=f}

cout<<sum1+sum2;


return 0;
}

Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include<iostream>
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:6:1: error: 'cin' was not declared in this scope
    6 | cin>>a>>b>>c>>d>>e>>f;
      | ^~~
a.cc:8:10: error: 'sum1' was not declared in this scope
    8 | {if(b>c){sum1=a+b}
      |          ^~~~
a.cc:9:6: error: 'sum2' was not declared in this scope
    9 | else{sum2=a+c}
      |      ^~~~
a.cc:12:10: error: 'sum1' was not declared in this scope
   12 | {if(a>c){sum1=b+a}
      |          ^~~~
a.cc:13:6: error: 'sum1' was not declared in this scope
   13 | else{sum1=b+c}
      |      ^~~~
a.cc:16:10: error: 'sum1' was not declared in this scope
   16 | {if(a>b){sum1=c+a}
      |          ^~~~
a.cc:17:6: error: 'sum1' was not declared in this scope
   17 | else{sum1=c+b}
      |      ^~~~
a.cc:19:9: error: 'sum2' was not declared in this scope
   19 | if(e>f){sum2=e}
      |         ^~~~
a.cc:20:6: error: 'sum2' was not declared in this scope
   20 | else{sum2=f}
      |      ^~~~
a.cc:22:1: error: 'cout' was not declared in this scope
   22 | cout<<sum1+sum2;
      | ^~~~
a.cc:22:7: error: 'sum1' was not declared in this scope
   22 | cout<<sum1+sum2;
      |       ^~~~
a.cc:22:12: error: 'sum2' was not declared in this scope
   22 | cout<<sum1+sum2;
      |            ^~~~
Language: C++

#include <iostream>
using namespace std;
int main(void)
{
	int a,b,c[100]={0},d,e=0,f=0,g,h,i;
	for (a=0;a<4;a++)
	{
		cin>>b;
		c[b]=1;
	}
	for (a=99;a>0;a--)
	{
		if (c[b]==1&&e!=3)
		{
			f=f+b;
			e++;
		}
	cin>>d>>e;
	if (d>=e)
	{
		g=d+f;
	}
	else
	{
		g=e+f;
	}
	cout<<g<<endl;
	return 0;
}
	

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

#include<iostream>
using namespace std;
int i, sumrika=0, sumsha=0, t, u, cnt=0;
int minrika=110, minsha=110;
int rika[5], dha[3];
int main(){
for(i=1; i<=4; i++){
   cin>>rika[i]; sumrika+=rika[i];
   if(rika[i]<minrika){minrika=rika[i];}
}
for(i=1; i<=2; i++){
    cin>>sha[i]; sumsha+=sha[i];
    if(sha[i]<minsha){minsha=sha[i];}
}
int disp = (sumrika-minrika)+(sumsha-minsha);
cout << disp << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:10: error: 'sha' was not declared in this scope; did you mean 'dha'?
   12 |     cin>>sha[i]; sumsha+=sha[i];
      |          ^~~
      |          dha
Language: C++

#include<iostream>

using namespace std;

int a[4],b[2];

int main(){
    cin>>a[0]>>a[1]>>a[2]>>a[3]>>b[0]>>b[1];
    sort(a,a+4);sort(b,b+2);
    cout<<a[1]+a[2]+a[3]+b[1]<<endl;
}


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

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

int main() {
  vector<int> s1;
  vector<int> s2;

  int S1, S2;

  for(int i; i < 4; i++) {
    cin >> S1;
    s1.push_back(S1);
  }

  for(int i; i < 2; i++) {
    cin >> S2;
    s2.push_back(S2);
  }

  sort(s1.begin(), s1.end(), greater<int>);
  sort(s2.begin(), s2.end(), greater<int>);

  int sum	= 0;
  for(int i = 0; i < 3; i++) {
    sum += s1[i];
  }
  for(int i = 0; i < 2; i++) {
    sum += s2[i];
  }

  cout << sum << endl;

  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:22:42: error: expected primary-expression before ')' token
   22 |   sort(s1.begin(), s1.end(), greater<int>);
      |                                          ^
a.cc:23:42: error: expected primary-expression before ')' token
   23 |   sort(s2.begin(), s2.end(), greater<int>);
      |                                          ^
Language: Java

#include<iostream>
using namespace std;int main(){int a[100];int b,c;cin>>b>>c;for (int d = 0; d < b; d++) cin>>a[d];for(int k=2;k<=c;k++)for(int g=0;g<b-1;g++)if(a[g]% k>a[g+1] % k)swap(a[g],a[g + 1]);for(int s=0;s<b;s++)cout<<a[s]<<endl;}

Compiler output:
Main.java:1: error: illegal character: '#'
#include<iostream>
^
Main.java:1: error: class, interface, enum, or record expected
#include<iostream>
        ^
Main.java:2: error: not a statement
using namespace std;int main(){int a[100];int b,c;cin>>b>>c;for (int d = 0; d < b; d++) cin>>a[d];for(int k=2;k<=c;k++)for(int g=0;g<b-1;g++)if(a[g]% k>a[g+1] % k)swap(a[g],a[g + 1]);for(int s=0;s<b;s++)cout<<a[s]<<endl;}
                                                        ^
Main.java:2: error: not a statement
using namespace std;int main(){int a[100];int b,c;cin>>b>>c;for (int d = 0; d < b; d++) cin>>a[d];for(int k=2;k<=c;k++)for(int g=0;g<b-1;g++)if(a[g]% k>a[g+1] % k)swap(a[g],a[g + 1]);for(int s=0;s<b;s++)cout<<a[s]<<endl;}
                                                                                           ^
Main.java:2: error: not a statement
using namespace std;int main(){int a[100];int b,c;cin>>b>>c;for (int d = 0; d < b; d++) cin>>a[d];for(int k=2;k<=c;k++)for(int g=0;g<b-1;g++)if(a[g]% k>a[g+1] % k)swap(a[g],a[g + 1]);for(int s=0;s<b;s++)cout<<a[s]<<endl;}
                                                                                                                                                                                                                     ^
Main.java:2: error: unnamed classes are a preview feature and are disabled by default.
using namespace std;int main(){int a[100];int b,c;cin>>b>>c;for (int d = 0; d < b; d++) cin>>a[d];for(int k=2;k<=c;k++)for(int g=0;g<b-1;g++)if(a[g]% k>a[g+1] % k)swap(a[g],a[g + 1]);for(int s=0;s<b;s++)cout<<a[s]<<endl;}
                    ^
  (use --enable-preview to enable unnamed classes)
Main.java:2: error: ']' expected
using namespace std;int main(){int a[100];int b,c;cin>>b>>c;for (int d = 0; d < b; d++) cin>>a[d];for(int k=2;k<=c;k++)for(int g=0;g<b-1;g++)if(a[g]% k>a[g+1] % k)swap(a[g],a[g + 1]);for(int s=0;s<b;s++)cout<<a[s]<<endl;}
                                     ^
7 errors
Language: C

#include<cstdio>
#include<algorithm>
using namespace std;
int main(void)
{
	int a[101],k,i,j,m,n,x1,x2;
	scanf("%d %d",&n,&m);
//	printf("n=%d n=%d\n",n,m);
	for(i=1;i<=n;i++)	scanf("%d",&a[i]);
//	printf("aaa\n");
	for(i=1;i<=m;i++)	{
		for(j=1;j<n;j++){
			x1=a[j]%i; x2=a[j+1]%i;
				if(x2<x1)	swap(a[j],a[j+1]);
		}
	}
	for(i=1;i<=n;i++)	printf("%d\n",a[i]);
	return 0;
}


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

#include<cstdio>
#include<algorithm>
using namespace std;
int main(void)
{
	int a[101],k,i,j,m,n,x1,x2;
	scanf("%d %d",&n,&m);
	for(i=1;i<=n;i++)	scanf("%d",&a[i]);
	for(i=1;i<=m;i++)	{
		for(j=1;j<n;j++){
			x1=a[j]%i; x2=a[j+1]%i;
				if(x2<x1)	swap(a[j],a[j+1]);
		}
	}
	for(i=1;i<=n;i++)	printf("%d\n",a[i]);
	return 0;
}


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

#include<stdio.h>
int main(){
	int n,m,k,i,j,a[101],te;
	while(1){
	scanf("%d,&n);
	if(n==0){
		break;
	}
	scanf("%d,&m);
	for(j=1;j<n;j++){
		scanf("%d",&a[j]);
	}
	i=1;
	for(j=1;j<=m;){
		if(i<n&&1<i){
			if(a[j]%j>a[j+1]%j){
			te=a[j];
			a[j]=a[j+1];
			a[j+1]=te;
			i++;
		}
		else{
			i++;
		}
		if(i==n){
			j++;
		}
	}
	for(j=1;j<=n;j++){
		printf("%d",a[j]);
	}
	}
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:15: warning: missing terminating " character
    5 |         scanf("%d,&n);
      |               ^
main.c:5:15: error: missing terminating " character
    5 |         scanf("%d,&n);
      |               ^~~~~~~~
main.c:6:9: error: expected expression before 'if'
    6 |         if(n==0){
      |         ^~
main.c:9:15: warning: missing terminating " character
    9 |         scanf("%d,&m);
      |               ^
main.c:9:15: error: missing terminating " character
    9 |         scanf("%d,&m);
      |               ^~~~~~~~
main.c:34:1: error: expected declaration or statement at end of input
   34 | }
      | ^
main.c:34:1: error: expected declaration or statement at end of input
Language: C

#include<stdio.h>
int main(){
	int n,m,k,i,j,a[101],te;
	while(1){
	scanf("%d",&n);
	if(n==0){
		break;
	}
	scanf("%d",&m);
	for(j=1;j<n;j++){
		scanf("%d",&a[j]);
	}
	i=1;
	for(j=1;j<=m;){
		if(i<n&&1<i){
			if(a[j]%j>a[j+1]%j){
			te=a[j];
			a[j]=a[j+1];
			a[j+1]=te;
			i++;
		}
		else{
			i++;
		}
		if(i==n){
			j++;
		}
	}
	for(j=1;j<=n;j++){
		printf("%d",a[j]);
	}
	}
	return 0;
}

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

#include<stdio.h>
int main(){
	int n,m,k,i,j,a[101],te;
	scanf("%d",&n);
	scanf("%d",&m);
	for(j=1;j<n;j++){
		scanf("%d",&a[j]);
	}
	i=1;
	for(j=1;j<=m;){
		if(i<n&&1<i){
			if(a[i]%j>a[i+1]%j){
			te=a[i];
			a[i]=a[i+1];
			a[i+1]=te;
			i++;
		}
		else{
			i++;
		}
		if(i==n){
			j++;
		}
	}
	for(j=1;j<=n;j++){
		printf("%d",a[j]);
	}
	return 0;
}

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

#include<iostream>
using namespace std;
int n,m,a[1000];
int main(){
	cin>>n>>m;
	for(int i=0;i<n;i++){cin>>a[i];}
	for(int i=1;i<n;i++){
		if(a[i]%k>a[i+1]%k){swap(a[i],a[i+1]);}
	}
	for(int i=0;i<n;i++)cout<<a[i]<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:25: error: 'k' was not declared in this scope
    8 |                 if(a[i]%k>a[i+1]%k){swap(a[i],a[i+1]);}
      |                         ^
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
int main()
{
	int a = 0, b = 0;
	int c[100];
	cin >> a >> b;
	for (int i = 0; i < a; i++)
	{
		cin >> c[i];
	}
	for (int i = 1; i <= b; i++)
	{
		for (int j = 0; j < (a - 1); j++)
		{
			if ((c[j] % i)>(c[j + 1] % i))
			{
				int k = c[j];
				c[j] = c[j + 1];
				c[j + 1] = k;
			}
		}
	}
	for (int i = 0; i < a; i++)
	{
		cout << c[i] << endl;
	}

	gereturn 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:31:9: error: 'gereturn' was not declared in this scope
   31 |         gereturn 0;
      |         ^~~~~~~~
Language: C++

#include<iostream>
#include<algorithm>
using namespace std;
int main() {
	int n;//JOI?????????????????°
	int m;//?????????????????°
	int person[101] = { 0 };//???????????????
	int baton[101] = { 0 };
	cin >> n >> m;
	for (int i = 1; i <= n; i++) {
		cin >> person[i];
	}
	//cout << "ruio";
	for (int k = 1; k <= m; k++) {
		int i = 1;
		//cout << "ruio";
		while (i != n) {
			if (1 <= i&&i <= n - 1) {
				if (person[i] % k > person[i + 1] % k) {
					//	cout << "ruio";
					swap(person[i], person[i + 1]);
					i = i + 1;
				}
				else {
					i = i + 1;
				}
			}
		}
	for (int i = 1; i <= n; i++) {
		cout << person[i] << endl;
	}
}

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

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

int main(){
    int N,M;
    cin >>N>>M;
    int A[N];
    for(int i=0;int<N;++i){
        cin >>A[i];
    }
    
    for(int k=1;k<M+1;++k){
    for(int a=0,a<N+1,++a){
    if(1<=a&&a<N){
        if(A[a]%k>A[a+1]%k){
            temp = A[a]
            A[a]=A[a+1]
            A[a+1]=temp
            
        }
        else{
        }
        }
    else{
        break;
    }
    }
    }
    
    for(int w=0;w<N;++w){
        cout <<A[w]<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: 'int' is not a template
    9 |     for(int i=0;int<N;++i){
      |                 ^~~
a.cc:9:17: error: expected primary-expression before 'int'
a.cc:9:17: error: expected ';' before 'int'
    9 |     for(int i=0;int<N;++i){
      |                 ^~~
      |                 ;
a.cc:9:17: error: expected primary-expression before 'int'
    9 |     for(int i=0;int<N;++i){
      |                 ^~~
a.cc:9:17: error: expected ')' before 'int'
    9 |     for(int i=0;int<N;++i){
      |        ~        ^~~
      |                 )
a.cc:9:17: error: declaration does not declare anything [-fpermissive]
    9 |     for(int i=0;int<N;++i){
      |                 ^~~
a.cc:9:25: error: 'i' was not declared in this scope
    9 |     for(int i=0;int<N;++i){
      |                         ^
a.cc:14:18: error: expected ';' before '<' token
   14 |     for(int a=0,a<N+1,++a){
      |                  ^
      |                  ;
a.cc:14:18: error: expected primary-expression before '<' token
a.cc:14:26: error: expected ';' before ')' token
   14 |     for(int a=0,a<N+1,++a){
      |                          ^
      |                          ;
a.cc:17:13: error: 'temp' was not declared in this scope; did you mean 'tm'?
   17 |             temp = A[a]
      |             ^~~~
      |             tm
Language: C++

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

int main(){
    int N,M;
    cin >>N>>M;
    int A[N];
    for(int i=0;int<N;++i){
        cin >>A[i];
    }
    
    for(int k=1;k<M+1;++k){
    for(int a=0,a<N+1,++a){
    if(1<=a&&a<N){
        if(A[a]%k>A[a+1]%k){
            temp = A[a];
            A[a]=A[a+1];
            A[a+1]=temp;
            
        }
        else{
        }
        }
    else{
        break;
    }
    }
    }
    
    for(int w=0;w<N;++w){
        cout <<A[w]<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: 'int' is not a template
    9 |     for(int i=0;int<N;++i){
      |                 ^~~
a.cc:9:17: error: expected primary-expression before 'int'
a.cc:9:17: error: expected ';' before 'int'
    9 |     for(int i=0;int<N;++i){
      |                 ^~~
      |                 ;
a.cc:9:17: error: expected primary-expression before 'int'
    9 |     for(int i=0;int<N;++i){
      |                 ^~~
a.cc:9:17: error: expected ')' before 'int'
    9 |     for(int i=0;int<N;++i){
      |        ~        ^~~
      |                 )
a.cc:9:17: error: declaration does not declare anything [-fpermissive]
    9 |     for(int i=0;int<N;++i){
      |                 ^~~
a.cc:9:25: error: 'i' was not declared in this scope
    9 |     for(int i=0;int<N;++i){
      |                         ^
a.cc:14:18: error: expected ';' before '<' token
   14 |     for(int a=0,a<N+1,++a){
      |                  ^
      |                  ;
a.cc:14:18: error: expected primary-expression before '<' token
a.cc:14:26: error: expected ';' before ')' token
   14 |     for(int a=0,a<N+1,++a){
      |                          ^
      |                          ;
a.cc:17:13: error: 'temp' was not declared in this scope; did you mean 'tm'?
   17 |             temp = A[a];
      |             ^~~~
      |             tm
Language: C++

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

int main(){
    int N,M;
    cin >>N>>M;
    int A[N];
    for(int i=0;int<N;++i){
        cin >>A[i];
    }
    
    for(int k=1;k<M+1;++k){
    for(int a=0,a<N+1,++a){
    if(1<=a&&a<N){
        if(A[a]%k>A[a+1]%k){
            int temp = A[a];
            A[a]=A[a+1];
            A[a+1]=temp;
            
        }
        else{
        }
        }
    else{
        break;
    }
    }
    }
    
    for(int w=0;w<N;++w){
        cout <<A[w]<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: 'int' is not a template
    9 |     for(int i=0;int<N;++i){
      |                 ^~~
a.cc:9:17: error: expected primary-expression before 'int'
a.cc:9:17: error: expected ';' before 'int'
    9 |     for(int i=0;int<N;++i){
      |                 ^~~
      |                 ;
a.cc:9:17: error: expected primary-expression before 'int'
    9 |     for(int i=0;int<N;++i){
      |                 ^~~
a.cc:9:17: error: expected ')' before 'int'
    9 |     for(int i=0;int<N;++i){
      |        ~        ^~~
      |                 )
a.cc:9:17: error: declaration does not declare anything [-fpermissive]
    9 |     for(int i=0;int<N;++i){
      |                 ^~~
a.cc:9:25: error: 'i' was not declared in this scope
    9 |     for(int i=0;int<N;++i){
      |                         ^
a.cc:14:18: error: expected ';' before '<' token
   14 |     for(int a=0,a<N+1,++a){
      |                  ^
      |                  ;
a.cc:14:18: error: expected primary-expression before '<' token
a.cc:14:26: error: expected ';' before ')' token
   14 |     for(int a=0,a<N+1,++a){
      |                          ^
      |                          ;
Language: C++

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

int main(){
    int N,M;
    cin >>N>>M;
    int A[N];
    for(int i=0;int<N;++i){
        cin >>A[i];
    }
    
    for(int k=1;k<M+1;++k){
        for(int a=0;a<N+1;++a){
    if(1<=a&&a<N){
        if(A[a]%k>A[a+1]%k){
            int temp = A[a];
            A[a]=A[a+1];
            A[a+1]=temp;
            
        }
        else{
        }
        }
    else{
        break;
    }
    }
    }
    
    for(int w=0;w<N;++w){
        cout <<A[w]<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: 'int' is not a template
    9 |     for(int i=0;int<N;++i){
      |                 ^~~
a.cc:9:17: error: expected primary-expression before 'int'
a.cc:9:17: error: expected ';' before 'int'
    9 |     for(int i=0;int<N;++i){
      |                 ^~~
      |                 ;
a.cc:9:17: error: expected primary-expression before 'int'
    9 |     for(int i=0;int<N;++i){
      |                 ^~~
a.cc:9:17: error: expected ')' before 'int'
    9 |     for(int i=0;int<N;++i){
      |        ~        ^~~
      |                 )
a.cc:9:17: error: declaration does not declare anything [-fpermissive]
    9 |     for(int i=0;int<N;++i){
      |                 ^~~
a.cc:9:25: error: 'i' was not declared in this scope
    9 |     for(int i=0;int<N;++i){
      |                         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,m,a[n];
    cin>>n>>m;
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    for(int k=1;i<m+1;k++){
        for(int i=0;i<n-2;i++){
        if(a[i]%k<a[i+1]%k){
            swap(a[i],a[1+i])
        }
    }
    }
    for(int i=0;i<n;i++){
        cout<<a[i]<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: 'i' was not declared in this scope
    9 |     for(int k=1;i<m+1;k++){
      |                 ^
a.cc:12:30: error: expected ';' before '}' token
   12 |             swap(a[i],a[1+i])
      |                              ^
      |                              ;
   13 |         }
      |         ~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,m,a[n];
    cin>>n>>m;
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    for(int k=1;k<m+1;k++){
        for(int i=0;i<n-2;i++){
            if(a[i]%k<a[i+1]%k){
               swap(a[i],a[1+i])
            }
        }
    }
    for(int i=0;i<n;i++){
        cout<<a[i]<<endl;
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:33: error: expected ';' before '}' token
   12 |                swap(a[i],a[1+i])
      |                                 ^
      |                                 ;
   13 |             }
      |             ~
Language: C++

#include<stdio.h>
int main(void)
{
	int n,m,x,i,k,a[100];
	scanf("%d %d",&n,&m);
	for(i=0;i<n;i++)	scanf("%d",&a[i]);
	for(k=1;k<=m;k++){
		for(i=0;i<n-1;i++){
			if(a[i]%k>a[i+1]%k) swap(a[i],a[i+1]);
		}
	}
	for(i=0;i<n;i++) printf("%d\n",a[i]);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:45: error: 'swap' was not declared in this scope
    9 |                         if(a[i]%k>a[i+1]%k) swap(a[i],a[i+1]);
      |                                             ^~~~
Language: C++

#include<stdio.h>
#include<algorithm>
using namespace str;
int main(void)
{
	int n,m,x,i,k,a[100];
	scanf("%d %d",&n,&m);
	for(i=0;i<n;i++)	scanf("%d",&a[i]);
	for(k=1;k<=m;k++){
		for(i=0;i<n-1;i++){
			if(a[i]%k>a[i+1]%k) swap(a[i],a[i+1]);
		}
	}
	for(i=0;i<n;i++) printf("%d\n",a[i]);
	return 0;
}

Compiler output:
a.cc:3:17: error: 'str' is not a namespace-name
    3 | using namespace str;
      |                 ^~~
a.cc: In function 'int main()':
a.cc:11:45: error: 'swap' was not declared in this scope
   11 |                         if(a[i]%k>a[i+1]%k) swap(a[i],a[i+1]);
      |                                             ^~~~
a.cc:11:45: note: suggested alternatives:
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_pair.h:1106:5: note:   'std::swap'
 1106 |     swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete;
      |     ^~~~
In file included from /usr/include/c++/14/bits/stl_pair.h:61:
/usr/include/c++/14/bits/move.h:226:5: note:   'std::swap'
  226 |     swap(_Tp& __a, _Tp& __b)
      |     ^~~~
/usr/include/c++/14/bits/move.h:226:5: note:   'std::swap'
Language: C++

#include<iostream>
using namespace std;
int s, b, Ns, Nb, z;
int a[101], r[101];
int main(){
    cin >> Ns >> Nb;
    for(s=1; s<=Ns; s++){cin>>a[s];}
    for(b=1; b<=Nb; b++){
        for(s=1; s<=Ns; s++){r[s] = a[s]%b;}
        for(s=1; s<=Ns-1; s++){if(r[s] > r[s+1]){
                                  swap(a[s], a[s+1);
                                  swap(r[s], r[s+1]);
                               }
        }
    }
    for(s=1; s<=Ns; s++){
        cout << a[s] << endl;
    }
}
void swap(int x, int y){
     z = x;
     x = y;
     y = z;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:51: error: expected ']' before ')' token
   11 |                                   swap(a[s], a[s+1);
      |                                                   ^
      |                                                   ]
Language: C++

#include<iostream>
using namespace std;
int s, b, Ns, Nb, z;
int a[101], r[101];
int main(){
    cin >> Ns >> Nb;
    for(s=1; s<=Ns; s++){cin>>a[s];}
    for(b=1; b<=Nb; b++){
        for(s=1; s<=Ns; s++){
            r[s] = a[s]%b;
        }
        for(s=1; s<=Ns-1; s++){
            if(r[s] > r[s+1]){
                swap(a[s], a[s+1);
                swap(r[s], r[s+1]);
            }
        }
    }
    for(s=1; s<=Ns; s++){
        cout << a[s] << endl;
    }
}
void swap(int x, int y){
     z = x;
     x = y;
     y = z;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:33: error: expected ']' before ')' token
   14 |                 swap(a[s], a[s+1);
      |                                 ^
      |                                 ]
Language: C++

#include<iostream>
using namespace std;
int s, b, Ns, Nb, z;
int z[101], r[101];
int main(){
    cin >> Ns >> Nb;
    for(s=1; s<=Ns; s++){cin>>z[s];}
    for(b=1; b<=Nb; b++){
        for(s=1; s<=Ns; s++){
            r[s] = z[s]%b;
        }
        for(s=1; s<=Ns-1; s++){
            if(r[s] > r[s+1]){
                swap(z[s], z[s+1);
                swap(r[s], r[s+1]);
            }
        }
    }
    for(s=1; s<=Ns; s++){
        cout << a[s] << endl;
    }
}
void swap(int x, int y){
     z = x;
     x = y;
     y = z;
}

Compiler output:
a.cc:4:5: error: conflicting declaration 'int z [101]'
    4 | int z[101], r[101];
      |     ^
a.cc:3:19: note: previous declaration as 'int z'
    3 | int s, b, Ns, Nb, z;
      |                   ^
a.cc: In function 'int main()':
a.cc:7:32: error: invalid types 'int[int]' for array subscript
    7 |     for(s=1; s<=Ns; s++){cin>>z[s];}
      |                                ^
a.cc:10:21: error: invalid types 'int[int]' for array subscript
   10 |             r[s] = z[s]%b;
      |                     ^
a.cc:14:23: error: invalid types 'int[int]' for array subscript
   14 |                 swap(z[s], z[s+1);
      |                       ^
a.cc:14:33: error: expected ']' before ')' token
   14 |                 swap(z[s], z[s+1);
      |                                 ^
      |                                 ]
a.cc:14:29: error: invalid types 'int[int]' for array subscript
   14 |                 swap(z[s], z[s+1);
      |                             ^
a.cc:20:17: error: 'a' was not declared in this scope
   20 |         cout << a[s] << endl;
      |                 ^
Language: C++

#include<iostream>
using namespace std;
int s, b, Ns, Nb, w;
int z[101], r[101];
int main(){
    cin >> Ns >> Nb;
    for(s=1; s<=Ns; s++){cin>>z[s];}
    for(b=1; b<=Nb; b++){
        for(s=1; s<=Ns; s++){
            r[s] = z[s]%b;
        }
        for(s=1; s<=Ns-1; s++){
            if(r[s] > r[s+1]){
                swap(z[s], z[s+1);
                swap(r[s], r[s+1]);
            }
        }
    }
    for(s=1; s<=Ns; s++){
        cout << a[s] << endl;
    }
}
void swap(int x, int y){
     w = x;
     x = y;
     y = w;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:33: error: expected ']' before ')' token
   14 |                 swap(z[s], z[s+1);
      |                                 ^
      |                                 ]
a.cc:20:17: error: 'a' was not declared in this scope
   20 |         cout << a[s] << endl;
      |                 ^
Language: C++

#include<iostream>
using namespace std;
int s, b, Ns, Nb;
int z[101], r[101];
int main(){
    cin >> Ns >> Nb;
    for(s=1; s<=Ns; s++){cin>>z[s];}
    for(b=1; b<=Nb; b++){
        for(s=1; s<=Ns; s++){
            r[s] = z[s]%b;
        }
        for(s=1; s<=Ns-1; s++){
            if(r[s] > r[s+1]){
                swap(z[s], z[s+1);
                swap(r[s], r[s+1]);
            }
        }
    }
    for(s=1; s<=Ns; s++){
        cout << a[s] << endl;
    }
}
void swap(int x, int y){
     int z;
     w = x;
     x = y;
     y = w;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:33: error: expected ']' before ')' token
   14 |                 swap(z[s], z[s+1);
      |                                 ^
      |                                 ]
a.cc:20:17: error: 'a' was not declared in this scope
   20 |         cout << a[s] << endl;
      |                 ^
a.cc: In function 'void swap(int, int)':
a.cc:25:6: error: 'w' was not declared in this scope
   25 |      w = x;
      |      ^
Language: C++

#include<iostream>
using namespace std;
int s, b, Ns, Nb;
int z[101], r[101];
int main(){
    cin >> Ns >> Nb;
    for(s=1; s<=Ns; s++){cin>>z[s];}
    for(b=1; b<=Nb; b++){
        for(s=1; s<=Ns; s++){
            r[s] = z[s]%b;
        }
        for(s=1; s<=Ns-1; s++){
            if(r[s] > r[s+1]){
                swap(z[s], z[s+1);
                swap(r[s], r[s+1]);
            }
        }
    }
    for(s=1; s<=Ns; s++){
        cout << a[s] << endl;
    }
}
void swap(int x, int y){
     int w;
     w = x;
     x = y;
     y = w;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:33: error: expected ']' before ')' token
   14 |                 swap(z[s], z[s+1);
      |                                 ^
      |                                 ]
a.cc:20:17: error: 'a' was not declared in this scope
   20 |         cout << a[s] << endl;
      |                 ^
Language: C++

#include<iostream>
using namespace std;
int s, b, nS, nB;
int z[101], r[101];
int main(){
    cin >> nS >> nB;
    for(s=1; s<=nS; s++){cin>>z[s];}
    for(b=1; b<=nB; b++){
        for(s=1; s<=nS; s++){
            r[s] = z[s]%b;
        }
        for(s=1; s<=Ns-1; s++){
            if(r[s] > r[s+1]){
                swap(z[s], z[s+1);
                swap(r[s], r[s+1]);
            }
        }
    }
    for(s=1; s<=nS; s++){
        cout << a[s] << endl;
    }
}
void swap(int x, int y){
     int w;
     w = x;
     x = y;
     y = w;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:21: error: 'Ns' was not declared in this scope; did you mean 's'?
   12 |         for(s=1; s<=Ns-1; s++){
      |                     ^~
      |                     s
a.cc:14:33: error: expected ']' before ')' token
   14 |                 swap(z[s], z[s+1);
      |                                 ^
      |                                 ]
a.cc:20:17: error: 'a' was not declared in this scope
   20 |         cout << a[s] << endl;
      |                 ^
Language: C++

#include<iostream>
using namespace std;
int s, b, nS, nB;
int z[101], r[101];
int main(){
    cin >> nS >> nB;
    for(s=1; s<=nS; s++){cin>>z[s];}
    for(b=1; b<=nB; b++){
        for(s=1; s<=nS; s++){
            r[s] = z[s]%b;
        }
        for(s=1; s<=nS-1; s++){
            if(r[s] > r[s+1]){
                swap(z[s], z[s+1);
                swap(r[s], r[s+1]);
            }
        }
    }
    for(s=1; s<=nS; s++){
        cout << a[s] << endl;
    }
}
void swap(int x, int y){
     int w;
     w = x;
     x = y;
     y = w;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:33: error: expected ']' before ')' token
   14 |                 swap(z[s], z[s+1);
      |                                 ^
      |                                 ]
a.cc:20:17: error: 'a' was not declared in this scope
   20 |         cout << a[s] << endl;
      |                 ^
Language: C++

#include<iostream>
using namespace std;
int s, b, nS, nB;
int z[101], r[101];
int main(){
    cin >> nS >> nB;
    for(s=1; s<=nS; s++){cin>>z[s];}
    for(b=1; b<=nB; b++){
        for(s=1; s<=nS; s++){
            r[s] = z[s]%b;
        }
        for(s=1; s<=nS-1; s++){
            if(r[s] > r[s+1]){
                swap(z[s], z[s+1]);
                swap(r[s], r[s+1]);
            }
        }
    }
    for(s=1; s<=nS; s++){
        cout << a[s] << endl;
    }
}
void swap(int x, int y){
     int w;
     w = x;
     x = y;
     y = w;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:20:17: error: 'a' was not declared in this scope
   20 |         cout << a[s] << endl;
      |                 ^
Language: C++

#include<iostream>
using namespace std;
int s, b, Ns, nB;
int a[101], r[101];
int main(){
    cin >> nS >> nB;
    for(s=1; s<=Ns; s++){cin>>a[s];}
    for(b=1; b<=nB; b++){
        for(s=1; s<=Ns; s++){
            r[s] = a[s]%b;
        }
        for(s=1; s<=Ns-1; s++){
            if(r[s] > r[s+1]){
                swap(a[s], a[s+1]);
                swap(r[s], r[s+1]);
            }
        }
    }
    for(s=1; s<=Ns; s++){
        cout << a[s] << endl;
    }
}
void swap(int x, int y){
     int w;
     w = x;
     x = y;
     y = w;
}

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

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

int main(void) {
  int n, m;
  scanf("%d%d", &n, &n);
  int a[n];
  rep(i, n) scanf("%d", &a[i]);
  rep(i, m) 
    rep(j, n - 1) 
      if(a[j] % i < a[j + 1] % i) int t = a[j], a[j] = a[j + 1], a[j + 1] - t;
  rep(i, n) printf("%d\n", a[i]);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:63: error: array must be initialized with a brace-enclosed initializer
   11 |       if(a[j] % i < a[j + 1] % i) int t = a[j], a[j] = a[j + 1], a[j + 1] - t;
      |                                                        ~~~~~~~^
a.cc:11:75: error: expected initializer before '-' token
   11 |       if(a[j] % i < a[j + 1] % i) int t = a[j], a[j] = a[j + 1], a[j + 1] - t;
      |                                                                           ^
Language: C++

#include<iostream>
int main() {
	std::cout << "Hello World" << std::endl;
	return 0;
}

#include<iostream>
int main() {
	std::cout << "Hello World" << std::endl;
	return 0;
}




Compiler output:
a.cc:8:5: error: redefinition of 'int main()'
    8 | int main() {
      |     ^~~~
a.cc:2:5: note: 'int main()' previously defined here
    2 | int main() {
      |     ^~~~
Language: C

#include <stdio.h>
#include <algorithm>
using namespace std;
int n;
int m;
int cc;
int ans=9999;
char c[50][50];
int main(){
   scanf("%d%d",&n,m);
   for(int i=0;i<n;i++){
    scanf("%s",&c[i]);
    }
   for(int j=0;j<=n-2;j++){
      if(j==0){break;}
      for(int i=0;i<=n-j-1;i++){
         for(int k=0;k<j;k++){
            for(int l=0;l<m;l++){
                if(c[k][l]=='B'||c[k][l]=='R'){
                  cc++;
                  }                  
               }
            }
         for(int k=0;k<i;k++){
            if(k<j){break;}
            for(int l=0;l<m;l++){
                if(c[k][l]=='W'||c[k][l]=='R'){
                  cc++;
                  }                  
               }
            }
         for(int k=0;k<n-j-i;k++){
            if(k<i){break;}
            for(int l=0;l<m;l++){
                if(c[k][l]=='W'||c[k][l]=='B'){
                  cc++;
                  }                  
               }
            }
           if(cc<ans){
              ans=cc;
}
           cc=0;
          }

       }
printf("%d\n",ans);

}

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

#include<iostream>
using namespace std;
int i, j, l;
char a[50][51];
int x[125000], min = 150000;
int n, m, k, cntW, cntB, cntR, cnt = 0;
#define I for(i=0;i<n;i++)
#define Wp cntW++
#define Bp cntB++
#define Rp cntR++
int main(void) {
	cin >> n >> m;
	I{
		x[i] = 0;
	}
		I{
		cin >> a[i];
	}
	for (i = 0; i<n - 2; i++) {
		for (j = i + 1; j<n - 1; j++) {
			for (k = 0; k <= i; k++) {
				cntW = 0;
				for (l = 0; l<m; l++) {
					if (a[k][l] == 'W')Wp;
				}
				x[cnt] += m - cntW;
			}
			for (k = i + 1; k <= j; k++) {
				cntB = 0;
				for (l = 0; l<m; l++) {
					if (a[k][l] == 'B')Bp;
				}
				x[cnt] += m - cntB;
			}
			for (k = j + 1; k<n; k++) {
				cntR = 0;
				for (l = 0; l<m; l++) {
					if (a[k][l] == 'R')Rp;
				}
				x[cnt] += m - cntR;
			}
			cnt++;
		}
	}
	for (i = 0; i<cnt; i++) {
		if (min>x[i]) {
			min = x[i];
		}
	}
	cout << min << endl;
	return 0;
}


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

#include<iostream>
using namespace std;
int i, j, l;
char a[50][51];
int x[125000], min = 150000;
int n, m, k, cntW, cntB, cntR, cnt = 0;
#define I for(i=0;i<n;i++)
#define Wp cntW++
#define Bp cntB++
#define Rp cntR++
int main(void) {
	cin >> n >> m;
	I{
		x[i] = 0;
	}
		I{
		cin >> a[i];
	}
	for (i = 0; i<n - 2; i++) {
		for (j = i + 1; j<n - 1; j++) {
			for (k = 0; k <= i; k++) {
				cntW = 0;
				for (l = 0; l<m; l++) {
					if (a[k][l] == 'W')Wp;
				}
				x[cnt] += m - cntW;
			}
			for (k = i + 1; k <= j; k++) {
				cntB = 0;
				for (l = 0; l<m; l++) {
					if (a[k][l] == 'B')Bp;
				}
				x[cnt] += m - cntB;
			}
			for (k = j + 1; k<n; k++) {
				cntR = 0;
				for (l = 0; l<m; l++) {
					if (a[k][l] == 'R')Rp;
				}
				x[cnt] += m - cntR;
			}
			cnt++;
		}
	}
	for (i = 0; i<cnt; i++) {
		if (min>x[i]) {
			min = x[i];
		}
	}
	cout << min-1 << endl;
	return 0;
}


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