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

#include <stdio.h>
#include <math.h>
#include <string.h>
#include <iostream>
#include <map>
using namespace std;
int xSort(const void * a, const void * b)
{
	if (*(long *)a < *(long *)b) {
		return 1;
	}
	else
		if (*(long *)a == *(long *)b) {
			return 0;
		}
	return -1;
}
int main()
{
	long lnCnt = 0;
	cin >> lnCnt;

	long lnVal0[100001];
	long lnVal1[100001];
	memset(lnVal0, 0, sizeof(lnVal0));
	memset(lnVal1, 0, sizeof(lnVal1));
	long lnMaxValX = 0;
	long lnMaxValY = 0;
	long lnSize0 = (lnCnt / 2 + lnCnt % 2);		// 偶数項目のサイズ
	long lnSize1 = (lnCnt / 2);					// 奇数項目のサイズ

	for (int i = 0; i < lnCnt; i++)
	{
		long lnInput = 0;
		cin >> lnInput;

		if (i % 2)
		{
			lnVal1[lnInput]++;
			if (lnVal1[lnInput] > lnMaxValY)
				lnMaxValY = lnInput;
		}
		else
		{
			lnVal0[lnInput]++;
			if (lnVal0[lnInput] > lnMaxValX)
				lnMaxValX = lnInput;
		}
	}

	qsort(lnVal0, sizeof(lnVal0)/ sizeof(long), sizeof(long), xSort);
	qsort(lnVal1, sizeof(lnVal1)/ sizeof(long), sizeof(long), xSort);

	long lnOutVal = 0;

	long lnX = 0;
	if (lnVal0[0] != lnSize0)
		lnX = lnSize0 - lnVal0[0];
	long lnY = 0;
	if (lnVal1[0] != lnSize1)
		lnY = lnSize1 - lnVal1[0];

	if (lnMaxValX == lnMaxValY)
	{
		if (lnVal0[1] <= lnVal1[1])
		{
			lnY = 0;
			if(Val1[1] != lnSize1)
				lnY = lnSize1 - lnVal1[0];
			lnOutVal = lnX + lnY;
		}
		else
		{
			lnX = 0;
			if (Val0[1] != lnSize0)
				lnX = lnSize0 - lnVal0[1];
			lnOutVal = (lnSize0 - lnVal0[1]) + lnY;
		}
	}
	else
	{
		lnOutVal = lnX + lnY;
	}

	cout << lnOutVal;
	getchar();

	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:68:28: error: 'Val1' was not declared in this scope; did you mean 'lnVal1'?
   68 |                         if(Val1[1] != lnSize1)
      |                            ^~~~
      |                            lnVal1
a.cc:75:29: error: 'Val0' was not declared in this scope; did you mean 'lnVal0'?
   75 |                         if (Val0[1] != lnSize0)
      |                             ^~~~
      |                             lnVal0
Language: C++

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

int main(){
string a;
cin >> a;
for(int i = 0;i < 3;i++){
if(a[i] == '1'){
cout << 9;
}else{
cout << 1;
}
cout << endl;
return 0;
}

Compiler output:
a.cc:2:1: error: 'uisng' does not name a type
    2 | uisng namespace std;
      | ^~~~~
a.cc: In function 'int main()':
a.cc:5:1: error: 'string' was not declared in this scope
    5 | string a;
      | ^~~~~~
a.cc:5:1: note: suggested alternatives:
In file included from /usr/include/c++/14/string:41,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52,
                 from a.cc:1:
/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:6:1: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 | cin >> a;
      | ^~~
      | std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:6:8: error: 'a' was not declared in this scope
    6 | cin >> a;
      |        ^
a.cc:9:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
    9 | cout << 9;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:11:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   11 | cout << 1;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:13:1: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   13 | cout << endl;
      | ^~~~
      | std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:13:9: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   13 | cout << endl;
      |         ^~~~
      |         std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
a.cc:15:2: error: expected '}' at end of input
   15 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <map>
#include <algorithm>
#include <numeric>
 
using namespace std;
 
int main(void){
  int n;
  cin >> n;
  vector<int> v;
  for(int i = 0; i<n;i++){
    int b;
    cin >> b;
    v.push_back(b);
  }
  map<int,int> m0;
  map<int,int> m1;
  int flag = 1;
  for(int i=0;i<n;i++){
    if (v[0] != v[i]) flag = 0;
    if (i%2 == 0) {
      if (m0.find(v[i]) == m0.end()) m0[v[i]] = 1;
      else m0[v[i]] += 1;
    } else {
      if (m1.find(v[i]) == m1.end()) m1[v[i]] = 1;
      else m1[v[i]] += 1;
    }
  }
  if (flag == 1) {cout << n/2; return 0;}
  int maxm0 = 0;
  int secm0 = 0;
  int keym0 = 0;
  int seckeym0 = 0;
  int maxm1 = 0;
  int secm1 = 0;
  int keym1 = 0;
  int seckeym1 = 0;
  int summ0 = 0;
  int summ1 = 0;
  for(map<int,int>::iterator itr = m0.begin(); itr != m0.end(); ++itr) {
    if(maxm0 < itr->second) { maxm0 = itr->second; keym0 = itr->first; secm0 = maxm0; seckeym0 = keym0;}
    summ0 += itr->second;
  }
  for(map<int,int>::iterator itr = m1.begin(); itr != m1.end(); ++itr) {
    if(maxm1 < itr->second) { maxm1 = itr->second; keym1 = itr->first; secm1 = maxm1; seckeym1 = keym1;}
    summ1 += itr->second;
  }
 
  if(keym0 == keym1) {
    int ans = 100001;
    if (maxm0 > maxm1) {
      int tmp = summ0 + summ1 - maxm0 - secm1;
      if (tmp < ans) ans = tmp;
    } else {
      int tmp = summ0 + summ1 - maxm1 - secm0;
      if (tmp < ans) ans = tmp;
    }
    cout << tmp;
  }else
    cout << summ0 + summ1 - maxm0 - maxm1;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:61:13: error: 'tmp' was not declared in this scope; did you mean 'tm'?
   61 |     cout << tmp;
      |             ^~~
      |             tm
Language: C++

#include <iostream>
using namespace std;
int main(){
  int num;
 cin>>num;
  if(num==111)cout<<999
  	else if(num==119)cout<<991
    	else if(num=199)cout<<911
      		else if(num==999)cout<<111
              else if(num==991)cout<<119
                else if(num==911)cout<<199
                  else if(num==919)cout<<191
                    else if(num==191)cout<<919
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:24: error: expected ';' before 'else'
    6 |   if(num==111)cout<<999
      |                        ^
      |                        ;
    7 |         else if(num==119)cout<<991
      |         ~~~~
Language: C++

#include "pch.h"
#pragma warning( disable : 4996)
//头文件
#include<algorithm>
#include<cmath>
#include<cstring>
//#include<iomanip>
//#include<iosfwd>
#include<string>
//宏定义
//#define INF 0x3f3f3f3f
//#define EPSILON 1e-8
//#define PI 3.14159265
//#define WYTHOFFa 1.6180339887
//#define WYTHOFFb 0.6180339887
//其它
//std::ios::sync_with_stdio(false); 
#include<iostream>
using namespace std;
/*int numodd[50005],numeven[50005];
int rateodd[50005][2], rateeven[50005][2];
int N,i,j,tmp;
int findMostFrequent()
{
	sort(numodd, numodd + N);
	sort(numeven, numeven + N);
	for (i =j= 0; i < N; ++i)
	{
		tmp=numodd[i];
		rateodd[j][0] = tmp;

	}
}
int main()
{
	while (cin >> N)
	{
		N >> 1;
		for (i = 0; i < N; ++i)
			cin >> numodd[i]>>numeven[i];

	}
}*/
int main()
{
	char f;
	while (cin.get(f))
	{
		if (f == '1')
			cout << '9';
		else
			cout << '1';
		cin.get(f);
			if (f == '1')
				cout << '9';
			else
				cout << '1';
			cin.get(f);
			if (f == '1')
				cout << '9';
			else
				cout << '1';
			cin.get(f);
			cout << endl;
	}
	return 0;
}

Compiler output:
a.cc:1:10: fatal error: pch.h: No such file or directory
    1 | #include "pch.h"
      |          ^~~~~~~
compilation terminated.
Language: C++


        if (odd[o] > even[e]) {
            e = secondIndent(even, 10, e);
        } else {
            o = secondIndent(odd, 10, o);
        }
    }
 
    int cnt_even = 0;
    int cnt_odd = 0;
    for (int i = 0; i < 10; i++) {
        if (i != e) {
            cnt_even += even[i];
        }
 
        if (i != o) {
            cnt_odd += odd[i];
        }
 
    }
 
    cout << cnt_even + cnt_odd << endl;
 
    return 0;
}

Compiler output:
a.cc:2:9: error: expected unqualified-id before 'if'
    2 |         if (odd[o] > even[e]) {
      |         ^~
a.cc:4:11: error: expected unqualified-id before 'else'
    4 |         } else {
      |           ^~~~
a.cc:7:5: error: expected declaration before '}' token
    7 |     }
      |     ^
a.cc:11:5: error: expected unqualified-id before 'for'
   11 |     for (int i = 0; i < 10; i++) {
      |     ^~~
a.cc:11:21: error: 'i' does not name a type
   11 |     for (int i = 0; i < 10; i++) {
      |                     ^
a.cc:11:29: error: 'i' does not name a type
   11 |     for (int i = 0; i < 10; i++) {
      |                             ^
a.cc:22:5: error: 'cout' does not name a type
   22 |     cout << cnt_even + cnt_odd << endl;
      |     ^~~~
a.cc:24:5: error: expected unqualified-id before 'return'
   24 |     return 0;
      |     ^~~~~~
a.cc:25:1: error: expected declaration before '}' token
   25 | }
      | ^
Language: C

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

int main(void)
{
     int a,b,c,str;

	scanf("%d", str);

	if(str[0]==1){
	a=9;
	}else{
	
	if(str[0]==9){
	a=1;
	}else{
	
	a=str[0];
	}}

	
	if(str[1]==1){
	b=9;
	}else{
	
	if(str[1]==9){
	b=1;
	}else{
	
	b=str[1];
	}};


	if(str[2]==1){
	c=9;
	}else{
	
	if(str[2]==9){
	c=1;
	}else{
	
	c=str[2];
	}};

	printf("%d",100*a+10*b+c);
}

Compiler output:
main.c: In function 'main':
main.c:10:15: error: subscripted value is neither array nor pointer nor vector
   10 |         if(str[0]==1){
      |               ^
main.c:14:15: error: subscripted value is neither array nor pointer nor vector
   14 |         if(str[0]==9){
      |               ^
main.c:18:14: error: subscripted value is neither array nor pointer nor vector
   18 |         a=str[0];
      |              ^
main.c:22:15: error: subscripted value is neither array nor pointer nor vector
   22 |         if(str[1]==1){
      |               ^
main.c:26:15: error: subscripted value is neither array nor pointer nor vector
   26 |         if(str[1]==9){
      |               ^
main.c:30:14: error: subscripted value is neither array nor pointer nor vector
   30 |         b=str[1];
      |              ^
main.c:34:15: error: subscripted value is neither array nor pointer nor vector
   34 |         if(str[2]==1){
      |               ^
main.c:38:15: error: subscripted value is neither array nor pointer nor vector
   38 |         if(str[2]==9){
      |               ^
main.c:42:14: error: subscripted value is neither array nor pointer nor vector
   42 |         c=str[2];
      |              ^
Language: C

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

int main(void)
{
	char str[8];

	scanf("%s", str);

	if(str[0]==1){
	char a[]="9";
    break;
	}else{
	
	if(str[0]==9){
	char a[]=1;
	}else{
	
	char a[]=str[0];
	}}

	
	if(str[1]==1){
	char b[]=9;
	}else{
	
	if(str[1]==9){
	char b[]=1;
	}else{
	
	char b[]=str[1];
	}};


	if(str[2]==1){
	char c[]="9";
	}else{
	
	if(str[2]==9){
	char c[]="1";
	}else{
	
	char c[]=str[2];
	}};

	printf("%s%s%s",a,b,c);
}

Compiler output:
main.c: In function 'main':
main.c:12:5: error: break statement not within loop or switch
   12 |     break;
      |     ^~~~~
main.c:16:18: error: invalid initializer
   16 |         char a[]=1;
      |                  ^
main.c:19:18: error: invalid initializer
   19 |         char a[]=str[0];
      |                  ^~~
main.c:24:18: error: invalid initializer
   24 |         char b[]=9;
      |                  ^
main.c:28:18: error: invalid initializer
   28 |         char b[]=1;
      |                  ^
main.c:31:18: error: invalid initializer
   31 |         char b[]=str[1];
      |                  ^~~
main.c:43:18: error: invalid initializer
   43 |         char c[]=str[2];
      |                  ^~~
main.c:46:25: error: 'a' undeclared (first use in this function)
   46 |         printf("%s%s%s",a,b,c);
      |                         ^
main.c:46:25: note: each undeclared identifier is reported only once for each function it appears in
main.c:46:27: error: 'b' undeclared (first use in this function)
   46 |         printf("%s%s%s",a,b,c);
      |                           ^
main.c:46:29: error: 'c' undeclared (first use in this function)
   46 |         printf("%s%s%s",a,b,c);
      |                             ^
Language: Java

import java.util.Scanner;

public class C111 {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();
		int a[]=new int[N/2];
		int b[]=new int[N/2];
		int d[]=new int[100001]; 
		int f[]=new int[100001]; 
		int l=N/2;
		for(int i=0;i<N/2;i++) {
			a[i]=in.nextInt();
			b[i]=in.nextInt();
		}
		
		for (int i = 0; i < l; i++) {
			d[a[i]]++;				// 頻度を数える：a[i]の値に該当する頻度値を1増やす
		}
		int max=1;
		for (int i = 1; i < 100001; i++) {
			if (d[i] > d[max]) {
				max = i;			// 最大頻度を求める
			}
		}
		
		for (int i = 0; i < l; i++) {
			f[b[i]]++;				// 頻度を数える：a[i]の値に該当する頻度値を1増やす
		}
		
		int max2=1;
		for (int i = 1; i < 100001; i++) {
			if (f[i] > f[max2]) {
				max2 = i;			// 最大頻度を求める
			}
		}
		
	    if(l-d[max]==0&&l-f[max2]==0&&b[0]==a[0]) {
	    	System.out.println(l);
	    }else {
	    	System.out.println(l-d[max]+(l-f[max2]));	    	
	    }

	}
}


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

#include<iostream>
#include<vector>
#include<algolithm>

int main(){
  std::vector<int> values;
  int n, p, q, r, sum;
  std::cin>>n;
  
  p=n/100;
  q=n/10/10;
  r=n%10;
  
  sum=p+q*10+r*100;
  
  std::cout<<sum<<"\n";
  
  return 0;
}
  

    

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

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

int main(void)
{
	char str[8];
     int a,b,c;

	scanf("%s", str);

	if(str[0]==1){
	a=9;
	}else{
	
	if(str[0]==9){
	a=1;
	}else{
	
	a=str[0];
	}}

	
	if(str[1]==1){
	b=9;
	}else
	
	if(str[1]==9){
	b=1;
	}else{
	
	b=str[1];
	}};


	if(str[2]==1){
	c=9;
	}else{
	
	if(str[2]==9){
	c=1;
	}else{
	
	c=str[2];
	}};

	printf("%d",100*a+10*b+c);
}

Compiler output:
main.c:35:9: error: expected identifier or '(' before 'if'
   35 |         if(str[2]==1){
      |         ^~
main.c:37:10: error: expected identifier or '(' before 'else'
   37 |         }else{
      |          ^~~~
main.c:46:16: error: expected declaration specifiers or '...' before string constant
   46 |         printf("%d",100*a+10*b+c);
      |                ^~~~
main.c:46:21: error: expected declaration specifiers or '...' before numeric constant
   46 |         printf("%d",100*a+10*b+c);
      |                     ^~~
main.c:47:1: error: expected identifier or '(' before '}' token
   47 | }
      | ^
Language: C++

N = list(input())
i = 0
while i < len(N):
    if N[i] == '1':
        N[i] = '9'
    else:
        N[i] = '1'
    i += 1
N = ''.join(N)
print(N)

Compiler output:
a.cc:9:5: error: empty character constant
    9 | N = ''.join(N)
      |     ^~
a.cc:1:1: error: 'N' does not name a type
    1 | N = list(input())
      | ^
Language: C

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

int main(void)
{
	char str[8];
     int a,b,c;

	scanf("%s", str);

	if(str[0]==1){
	a=9;
	}else{
	
	if(str[0]==9){
	a=1;
	}else{
	
	a=str[0];
	}}

	
	if(str[1]==1){
	b=9;
	}else
	
	if(str[1]==9){
	b=1;
	}else{
	
	b=str[1];
	}};


	if(str[2]==1){
	c=9;
	}else{
	
	if(str[2]==9){
	c=1;
	}else{
	
	c=str[2];
	}};

	printf("%d%d%d",&a,&b,&c);
}

Compiler output:
main.c:35:9: error: expected identifier or '(' before 'if'
   35 |         if(str[2]==1){
      |         ^~
main.c:37:10: error: expected identifier or '(' before 'else'
   37 |         }else{
      |          ^~~~
main.c:46:16: error: expected declaration specifiers or '...' before string constant
   46 |         printf("%d%d%d",&a,&b,&c);
      |                ^~~~~~~~
main.c:46:25: error: expected declaration specifiers or '...' before '&' token
   46 |         printf("%d%d%d",&a,&b,&c);
      |                         ^
main.c:46:28: error: expected declaration specifiers or '...' before '&' token
   46 |         printf("%d%d%d",&a,&b,&c);
      |                            ^
main.c:46:31: error: expected declaration specifiers or '...' before '&' token
   46 |         printf("%d%d%d",&a,&b,&c);
      |                               ^
main.c:47:1: error: expected identifier or '(' before '}' token
   47 | }
      | ^
Language: C++

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

int main(void)
{
	char str[8];
     int a,b,c;

	scanf("%s", str);

	if(str[0]==1){
	a=9;
	}else{
	
	if(str[0]==9){
	a=1;
	}else{
	
	a=str[0];
	}}

	
	if(str[1]==1){
	b=9;
	}else
	
	if(str[1]==9){
	b=1;
	}else{
	
	b=str[1];
	}}


	if(str[2]==1){
	c=9;
	}else{
	
	if(str[2]==9){
	c=1;
	}else{
	
	c=str[2];
	}};

	printf("%d%d%d",&a,&b,&c);
}


Compiler output:
a.cc:35:9: error: expected unqualified-id before 'if'
   35 |         if(str[2]==1){
      |         ^~
a.cc:37:10: error: expected unqualified-id before 'else'
   37 |         }else{
      |          ^~~~
a.cc:46:15: error: expected constructor, destructor, or type conversion before '(' token
   46 |         printf("%d%d%d",&a,&b,&c);
      |               ^
a.cc:47:1: error: expected declaration before '}' token
   47 | }
      | ^
Language: C++

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

int main(void)
{
	char str[8];
     int a,b,c;

	scanf("%s", str);

	if(str[0]==1){
	a=9;
	}else{
	
	if(str[0]==9){
	a=1;
	}else{
	
	a=str[0];
	}}

	
	if(str[1]==1){
	b=9;
	}else
	
	if(str[1]==9){
	b=1;
	}else{
	
	b=str[1];
	}};


	if(str[2]==1){
	c=9;
	}else{
	
	if(str[2]==9){
	c=1;
	}else{
	
	c=str[2];
	}};

	printf("%d%d%d",&a,&b,&c);
}

Compiler output:
a.cc:35:9: error: expected unqualified-id before 'if'
   35 |         if(str[2]==1){
      |         ^~
a.cc:37:10: error: expected unqualified-id before 'else'
   37 |         }else{
      |          ^~~~
a.cc:46:15: error: expected constructor, destructor, or type conversion before '(' token
   46 |         printf("%d%d%d",&a,&b,&c);
      |               ^
a.cc:47:1: error: expected declaration before '}' token
   47 | }
      | ^
Language: C

#include <stdio.h>

int henkan(int);

int main()
{
      int n;
      scanf("%d", &n);
      heikin(n);
      printf("%d\n", n);
      return 0;
}

int heikin(int n)
{
      n=1110-n;
      return;
}


Compiler output:
main.c: In function 'main':
main.c:9:7: error: implicit declaration of function 'heikin'; did you mean 'henkan'? [-Wimplicit-function-declaration]
    9 |       heikin(n);
      |       ^~~~~~
      |       henkan
main.c: In function 'heikin':
main.c:17:7: error: 'return' with no value, in function returning non-void [-Wreturn-mismatch]
   17 |       return;
      |       ^~~~~~
main.c:14:5: note: declared here
   14 | int heikin(int n)
      |     ^~~~~~
Language: C

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

int main(void)
{
	char str[8];

	scanf("%s", str);

	if(str[0]==1){
	char a[]=9;
	}else{
	
	if(str[0]==9){
	char a[]=1;
	}else{
	
	char a[]=str[0];
	}}

	
	if(str[1]==1){
	char b[]=9;
	}else
	
	if(str[1]==9){
	char b[]=1;
	}else{
	
	char b[]=str[1];
	}};


	if(str[2]==1){
	char c[]=9;
	}else{
	
	if(str[2]==9){
	char c[]=1;
	}else{
	
	char c[]=str[2];
	}};

	printf("%s%s%s",a,b,c);
}

Compiler output:
main.c: In function 'main':
main.c:11:18: error: invalid initializer
   11 |         char a[]=9;
      |                  ^
main.c:15:18: error: invalid initializer
   15 |         char a[]=1;
      |                  ^
main.c:18:18: error: invalid initializer
   18 |         char a[]=str[0];
      |                  ^~~
main.c:23:18: error: invalid initializer
   23 |         char b[]=9;
      |                  ^
main.c:27:18: error: invalid initializer
   27 |         char b[]=1;
      |                  ^
main.c:30:18: error: invalid initializer
   30 |         char b[]=str[1];
      |                  ^~~
main.c: At top level:
main.c:34:9: error: expected identifier or '(' before 'if'
   34 |         if(str[2]==1){
      |         ^~
main.c:36:10: error: expected identifier or '(' before 'else'
   36 |         }else{
      |          ^~~~
main.c:45:16: error: expected declaration specifiers or '...' before string constant
   45 |         printf("%s%s%s",a,b,c);
      |                ^~~~~~~~
main.c:45:25: error: unknown type name 'a'
   45 |         printf("%s%s%s",a,b,c);
      |                         ^
main.c:45:27: error: unknown type name 'b'
   45 |         printf("%s%s%s",a,b,c);
      |                           ^
main.c:45:29: error: unknown type name 'c'
   45 |         printf("%s%s%s",a,b,c);
      |                             ^
main.c:46:1: error: expected identifier or '(' before '}' token
   46 | }
      | ^
Language: C

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

int main(void)
{
	char str[8];

	scanf("%s", str);

	if(str[0]==1){
	char a[]="9";
	}else{
	
	if(str[0]==9){
	char a[]="1";
	}else{
	
	char a[]=str[0];
	}}

	
	if(str[1]==1){
	char b[]="9";
	}else
	
	if(str[1]==9){
	char b[]="1";
	}else{
	
	char b[]=str[1];
	}};


	if(str[2]==1){
	char c[]="9";
	}else{
	
	if(str[2]==9){
	char c[]="1";
	}else{
	
	char c[]=str[2];
	}};

	printf("%s%s%s",a,b,c);
}

Compiler output:
main.c: In function 'main':
main.c:18:18: error: invalid initializer
   18 |         char a[]=str[0];
      |                  ^~~
main.c:30:18: error: invalid initializer
   30 |         char b[]=str[1];
      |                  ^~~
main.c: At top level:
main.c:34:9: error: expected identifier or '(' before 'if'
   34 |         if(str[2]==1){
      |         ^~
main.c:36:10: error: expected identifier or '(' before 'else'
   36 |         }else{
      |          ^~~~
main.c:45:16: error: expected declaration specifiers or '...' before string constant
   45 |         printf("%s%s%s",a,b,c);
      |                ^~~~~~~~
main.c:45:25: error: unknown type name 'a'
   45 |         printf("%s%s%s",a,b,c);
      |                         ^
main.c:45:27: error: unknown type name 'b'
   45 |         printf("%s%s%s",a,b,c);
      |                           ^
main.c:45:29: error: unknown type name 'c'
   45 |         printf("%s%s%s",a,b,c);
      |                             ^
main.c:46:1: error: expected identifier or '(' before '}' token
   46 | }
      | ^
Language: C

#include <stdio.h>

int henkan(int);

int main()
{
      int n;
      scanf("%d", &n);
      heikin(n)
      printf("%d\n", n);
      return 0;
}

int heikin(int n)
{
      n=1110-n;
      return 0;
}


Compiler output:
main.c: In function 'main':
main.c:9:7: error: implicit declaration of function 'heikin'; did you mean 'henkan'? [-Wimplicit-function-declaration]
    9 |       heikin(n)
      |       ^~~~~~
      |       henkan
main.c:9:16: error: expected ';' before 'printf'
    9 |       heikin(n)
      |                ^
      |                ;
   10 |       printf("%d\n", n);
      |       ~~~~~~
Language: C

#include <stdio.h>

int henkan(int);

int main()
{
      int n;
      scanf("%d", &n);
      heikin(n)
      printf("%d\n", m);
      return 0;
}

int heikin(int n)
{
      int m;
      m=1110-n;
}

Compiler output:
main.c: In function 'main':
main.c:9:7: error: implicit declaration of function 'heikin'; did you mean 'henkan'? [-Wimplicit-function-declaration]
    9 |       heikin(n)
      |       ^~~~~~
      |       henkan
main.c:9:16: error: expected ';' before 'printf'
    9 |       heikin(n)
      |                ^
      |                ;
   10 |       printf("%d\n", m);
      |       ~~~~~~
Language: C

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

int main(void)
{

	char a[2];
	char b[2];
	char c[2];
	char str[8];

	scanf("%s", str);

	if(str[0]==1){
	a=9;
	}else{
	
	if(str[0]==9){
	a=1;
	}else{
	
	a=str[0];
	}}

	
	if(str[1]==1){
	b=9;
	}else
	
	if(str[1]==9){
	b=1;
	}else{
	
	b=str[1];
	}};


	if(str[2]==1){
	c=9;
	}else{
	
	if(str[2]==9){
	c=1;
	}else{
	
	c=str[2];
	}};

	printf("%s %s %s",a,b,c);
}

Compiler output:
main.c: In function 'main':
main.c:15:10: error: assignment to expression with array type
   15 |         a=9;
      |          ^
main.c:19:10: error: assignment to expression with array type
   19 |         a=1;
      |          ^
main.c:22:10: error: assignment to expression with array type
   22 |         a=str[0];
      |          ^
main.c:27:10: error: assignment to expression with array type
   27 |         b=9;
      |          ^
main.c:31:10: error: assignment to expression with array type
   31 |         b=1;
      |          ^
main.c:34:10: error: assignment to expression with array type
   34 |         b=str[1];
      |          ^
main.c: At top level:
main.c:38:9: error: expected identifier or '(' before 'if'
   38 |         if(str[2]==1){
      |         ^~
main.c:40:10: error: expected identifier or '(' before 'else'
   40 |         }else{
      |          ^~~~
main.c:49:16: error: expected declaration specifiers or '...' before string constant
   49 |         printf("%s %s %s",a,b,c);
      |                ^~~~~~~~~~
main.c:49:27: error: unknown type name 'a'
   49 |         printf("%s %s %s",a,b,c);
      |                           ^
main.c:49:29: error: unknown type name 'b'
   49 |         printf("%s %s %s",a,b,c);
      |                             ^
main.c:49:31: error: unknown type name 'c'
   49 |         printf("%s %s %s",a,b,c);
      |                               ^
main.c:50:1: error: expected identifier or '(' before '}' token
   50 | }
      | ^
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <cmath>

using namespace std;

int main(){
    string n;
    cin >> n;
    replace(n.begin(), n.end(), '1', 'a');
    replace(n.begin(), n.end(), '9', 'z');
    replace(n.begin(), n.end(), 'a', '9');
    replace(n.begin(), n.end(), 'z', '1');
    cout << n;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:5: error: 'replace' was not declared in this scope
   12 |     replace(n.begin(), n.end(), '1', 'a');
      |     ^~~~~~~
Language: C

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

int main(void)
{

	char a;
	char b;
	char c;
	char str[8];

	scanf("%s", str);

	if(str[0]==1){
	a=9;
	}else{
	
	if(str[0]==9){
	a=1;
	}else{
	
	a=str[0];
	}}

	
	if(str[1]==1){
	b=9;
	}else
	
	if(str[1]==9){
	b=1;
	}else{
	
	b=str[1];
	}};


	if(str[2]==1){
	c=9;
	}else{
	
	if(str[2]==9){
	c=1;
	}else{
	
	c=str[2];
	}};

	printf("%s %s %s",a,b,c);
}

Compiler output:
main.c:38:9: error: expected identifier or '(' before 'if'
   38 |         if(str[2]==1){
      |         ^~
main.c:40:10: error: expected identifier or '(' before 'else'
   40 |         }else{
      |          ^~~~
main.c:49:16: error: expected declaration specifiers or '...' before string constant
   49 |         printf("%s %s %s",a,b,c);
      |                ^~~~~~~~~~
main.c:49:27: error: unknown type name 'a'
   49 |         printf("%s %s %s",a,b,c);
      |                           ^
main.c:49:29: error: unknown type name 'b'
   49 |         printf("%s %s %s",a,b,c);
      |                             ^
main.c:49:31: error: unknown type name 'c'
   49 |         printf("%s %s %s",a,b,c);
      |                               ^
main.c:50:1: error: expected identifier or '(' before '}' token
   50 | }
      | ^
Language: C

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

int main(void)
{

	char a;
	char b;
	char c;
	char str[8];
	scanf("%s", str);

	if(str[0]==1){
	a=9;
	}else{
	
	if(str[0]==9){
	a=1;
	}else{
	
	a=str[0];
	}}
	
	if(str[1]==1){
	b=9;
	}else
	
	if(str[1]==9){
	b=1;
	}else{
	
	b=str[1];
	}}

	if (str[2]==1){
	c=9;
	}else{
	
	if (str[2]==9){
	c=1;
	}else{
	
	c=str[2];
	}}

	printf("%c %c %c",a,b,c);
}

Compiler output:
main.c:35:9: error: expected identifier or '(' before 'if'
   35 |         if (str[2]==1){
      |         ^~
main.c:37:10: error: expected identifier or '(' before 'else'
   37 |         }else{
      |          ^~~~
main.c:46:16: error: expected declaration specifiers or '...' before string constant
   46 |         printf("%c %c %c",a,b,c);
      |                ^~~~~~~~~~
main.c:46:27: error: unknown type name 'a'
   46 |         printf("%c %c %c",a,b,c);
      |                           ^
main.c:46:29: error: unknown type name 'b'
   46 |         printf("%c %c %c",a,b,c);
      |                             ^
main.c:46:31: error: unknown type name 'c'
   46 |         printf("%c %c %c",a,b,c);
      |                               ^
main.c:47:1: error: expected identifier or '(' before '}' token
   47 | }
      | ^
Language: C++

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

int main()
{
  long long n;
  long long  max1, max2,maxp1,maxp2,max12, max22,maxp12,maxp22;
  maxp1 = -1;
  maxp2 = -1;
  max1 = 0;
  max2 = 0;
  maxp12 = -1;
  maxp22 = -1;
  max12 = 0;
  max22 = 0;
  cin >> n;
  long long A[n];
  map<long,long> M1,M2;
  for (int i = 0; i < 100000; i++){
    M1[i] = 0;
    M2[i] = 0;
  }
  for (int i = 0; i < n; i++)
    cin >> A[i];

  for (int i = 0; i < n; i+= 2)
    M1[A[i]] += 1;

  for (int i = 1; i < n; i+= 2)
    M2[A[i]] += 1;


  for (int i = 0; i < 100000; i++) {
    if (M1[i] > max1){
      max1 = M1[i];
      maxp1 = i;
    }
    if (M2[i] > max2){
      max2 = M2[i];
      maxp2 = i;
    }
  }

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

#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
int main()
{
	string s;
        cin>>s;
       for(int i=0;i<3;i++)
       {
              if(s[i]=='1')

       }
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:13:8: error: expected primary-expression before '}' token
   13 |        }
      |        ^
Language: C

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

int main(void)
{

	char a;
	char b;
	char c;
	char str[8];
	scanf("%s", str);

	if(str[0]==1){
	a=9;
	}else{
	
	if(str[0]==9){
	a=1;
	}else{
	
	a=str[0];
	}}
	
	if(str[1]==1){
	b=9;
	}else
	
	if(str[1]==9){
	b=1;
	}else{
	
	b=str[1];
	}}

	if(str[2]==1){
	c=9;
	}else{
	
	if(str[2]==9){
	c=1;
	}else{
	
	c=str[2];
	}}

	printf("%c%c%c",a,b,c);
}

Compiler output:
main.c:35:9: error: expected identifier or '(' before 'if'
   35 |         if(str[2]==1){
      |         ^~
main.c:37:10: error: expected identifier or '(' before 'else'
   37 |         }else{
      |          ^~~~
main.c:46:16: error: expected declaration specifiers or '...' before string constant
   46 |         printf("%c%c%c",a,b,c);
      |                ^~~~~~~~
main.c:46:25: error: unknown type name 'a'
   46 |         printf("%c%c%c",a,b,c);
      |                         ^
main.c:46:27: error: unknown type name 'b'
   46 |         printf("%c%c%c",a,b,c);
      |                           ^
main.c:46:29: error: unknown type name 'c'
   46 |         printf("%c%c%c",a,b,c);
      |                             ^
main.c:47:1: error: expected identifier or '(' before '}' token
   47 | }
      | ^
Language: C

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

int main(void)
{

	char a;
	char b;
	char c;
	char str[8];
	scanf("%s", str)

	if(str[0]==1){
	a=9;
	}else{
	
	if(str[0]==9){
	a=1;
	}else{
	
	a=str[0];
	}}
	
	if(str[1]==1){
	b=9;
	}else
	
	if(str[1]==9){
	b=1;
	}else{
	
	b=str[1];
	}}

	if(str[2]==1){
	c=9;
	}else{
	
	if(str[2]==9){
	c=1;
	}else{
	
	c=str[2];
	}}

	printf("%c%c%c",a,b,c);
}

Compiler output:
main.c: In function 'main':
main.c:11:25: error: expected ';' before 'if'
   11 |         scanf("%s", str)
      |                         ^
      |                         ;
   12 | 
   13 |         if(str[0]==1){
      |         ~~               
main.c: At top level:
main.c:35:9: error: expected identifier or '(' before 'if'
   35 |         if(str[2]==1){
      |         ^~
main.c:37:10: error: expected identifier or '(' before 'else'
   37 |         }else{
      |          ^~~~
main.c:46:16: error: expected declaration specifiers or '...' before string constant
   46 |         printf("%c%c%c",a,b,c);
      |                ^~~~~~~~
main.c:46:25: error: unknown type name 'a'
   46 |         printf("%c%c%c",a,b,c);
      |                         ^
main.c:46:27: error: unknown type name 'b'
   46 |         printf("%c%c%c",a,b,c);
      |                           ^
main.c:46:29: error: unknown type name 'c'
   46 |         printf("%c%c%c",a,b,c);
      |                             ^
main.c:47:1: error: expected identifier or '(' before '}' token
   47 | }
      | ^
Language: C++

#include <stdio.h> int main(void){int n;scanf("%d",&n);printf("%d\n",1110-n);return 0;}

Compiler output:
a.cc:1:20: warning: extra tokens at end of #include directive
    1 | #include <stdio.h> int main(void){int n;scanf("%d",&n);printf("%d\n",1110-n);return 0;}
      |                    ^~~
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/14/../../../x86_64-linux-gnu/Scrt1.o: in function `_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status
Language: C

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

int main()
{

	char* str[4];
	char a;
	char b;
	char c;
	
	scanf("%s",&str);

	if(str[0]==1){
	a=9;
	}else{
	
	if(str[0]==9){
	a=1;
	}else{
	
	a=str[0];
	}}
	
	if(str[1]==1){
	b=9;
	}else
	
	if(str[1]==9){
	b=1;
	}else{
	
	b=str[1];
	}}

	if(str[2]==1){
	c=9;
	}else{
	
	if(str[2]==9){
	c=1;
	}else{
	
	c=str[2];
	}}

	printf("%c%c%c",&a,&b,&c);
}

Compiler output:
main.c: In function 'main':
main.c:14:18: warning: comparison between pointer and integer
   14 |         if(str[0]==1){
      |                  ^~
main.c:18:18: warning: comparison between pointer and integer
   18 |         if(str[0]==9){
      |                  ^~
main.c:22:10: error: assignment to 'char' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
   22 |         a=str[0];
      |          ^
main.c:25:18: warning: comparison between pointer and integer
   25 |         if(str[1]==1){
      |                  ^~
main.c:29:18: warning: comparison between pointer and integer
   29 |         if(str[1]==9){
      |                  ^~
main.c:33:10: error: assignment to 'char' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
   33 |         b=str[1];
      |          ^
main.c: At top level:
main.c:36:9: error: expected identifier or '(' before 'if'
   36 |         if(str[2]==1){
      |         ^~
main.c:38:10: error: expected identifier or '(' before 'else'
   38 |         }else{
      |          ^~~~
main.c:47:16: error: expected declaration specifiers or '...' before string constant
   47 |         printf("%c%c%c",&a,&b,&c);
      |                ^~~~~~~~
main.c:47:25: error: expected declaration specifiers or '...' before '&' token
   47 |         printf("%c%c%c",&a,&b,&c);
      |                         ^
main.c:47:28: error: expected declaration specifiers or '...' before '&' token
   47 |         printf("%c%c%c",&a,&b,&c);
      |                            ^
main.c:47:31: error: expected declaration specifiers or '...' before '&' token
   47 |         printf("%c%c%c",&a,&b,&c);
      |                               ^
main.c:48:1: error: expected identifier or '(' before '}' token
   48 | }
      | ^
Language: C

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

int main()
{

	char str[4];
	char a;
	char b;
	char c;
	
	scanf("%s",&str);

	if(str[0]==1){
	a=9;
	}else{
	
	if(str[0]==9){
	a=1;
	}else{
	
	a=str[0];
	}}
	
	if(str[1]==1){
	b=9;
	}else
	
	if(str[1]==9){
	b=1;
	}else{
	
	b=str[1];
	}}

	if(str[2]==1){
	c=9;
	}else{
	
	if(str[2]==9){
	c=1;
	}else{
	
	c=str[2];
	}}

	printf("%c%c%c",&a,&b,&c);
}

Compiler output:
main.c:36:9: error: expected identifier or '(' before 'if'
   36 |         if(str[2]==1){
      |         ^~
main.c:38:10: error: expected identifier or '(' before 'else'
   38 |         }else{
      |          ^~~~
main.c:47:16: error: expected declaration specifiers or '...' before string constant
   47 |         printf("%c%c%c",&a,&b,&c);
      |                ^~~~~~~~
main.c:47:25: error: expected declaration specifiers or '...' before '&' token
   47 |         printf("%c%c%c",&a,&b,&c);
      |                         ^
main.c:47:28: error: expected declaration specifiers or '...' before '&' token
   47 |         printf("%c%c%c",&a,&b,&c);
      |                            ^
main.c:47:31: error: expected declaration specifiers or '...' before '&' token
   47 |         printf("%c%c%c",&a,&b,&c);
      |                               ^
main.c:48:1: error: expected identifier or '(' before '}' token
   48 | }
      | ^
Language: C

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

int main()
{

	char n1[4];
	char a;
	char b;
	char c;
	
	scanf("%s",&n1);

	if(n1[0]==1){
	a=9;
	}else{
	
	if(n1[0]==9){
	a=1;
	}else{
	
	a=n1[0];
	}}
	
	if(n1[1]==1){
	b=9;
	}else
	
	if(n1[1]==9){
	b=1;
	}else{
	
	b=n1[1];
	}}

	if(n1[2]==1){
	c=9;
	}else{
	
	if(n1[2]==9){
	c=1;
	}else{
	
	c=n1[2];
	}}

	printf("%c%c%c",&a,&b,&c);
}

Compiler output:
main.c:36:9: error: expected identifier or '(' before 'if'
   36 |         if(n1[2]==1){
      |         ^~
main.c:38:10: error: expected identifier or '(' before 'else'
   38 |         }else{
      |          ^~~~
main.c:47:16: error: expected declaration specifiers or '...' before string constant
   47 |         printf("%c%c%c",&a,&b,&c);
      |                ^~~~~~~~
main.c:47:25: error: expected declaration specifiers or '...' before '&' token
   47 |         printf("%c%c%c",&a,&b,&c);
      |                         ^
main.c:47:28: error: expected declaration specifiers or '...' before '&' token
   47 |         printf("%c%c%c",&a,&b,&c);
      |                            ^
main.c:47:31: error: expected declaration specifiers or '...' before '&' token
   47 |         printf("%c%c%c",&a,&b,&c);
      |                               ^
main.c:48:1: error: expected identifier or '(' before '}' token
   48 | }
      | ^
Language: C++

#include <stdio.h>

int main()
{
    int n;
    int ans;
    // 整数の入力
    scanf("%d", &a);

    int ind;

    // process1
    int hundred = n / 100;
    ind = hundred == 9 ? 1 : hundred == 1 ? 9 : hundred;
    ans += ind * 100;

    // process2
    int ten = (n / 10) % 10
    ind = ten == 9 ? 1: ten == 1 ? 9 : ten;
    ans += ind * 10;

    // process3
    int one = n % 10;
    ind = one == 9 ? 1 : one == 1 ? 9 : one;
    ans += ind;

    // 出力
    printf(ans);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:18: error: 'a' was not declared in this scope
    8 |     scanf("%d", &a);
      |                  ^
a.cc:19:5: error: expected ',' or ';' before 'ind'
   19 |     ind = ten == 9 ? 1: ten == 1 ? 9 : ten;
      |     ^~~
a.cc:28:12: error: invalid conversion from 'int' to 'const char*' [-fpermissive]
   28 |     printf(ans);
      |            ^~~
      |            |
      |            int
In file included from a.cc:1:
/usr/include/stdio.h:363:43: note:   initializing argument 1 of 'int printf(const char*, ...)'
  363 | extern int printf (const char *__restrict __format, ...);
      |                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
Language: C

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

int main()
{

	char n[4];
	char a;
	char b;
	char c;
	
	scanf("%s",&n);

	if(n[0]==1){
	a=9;
	}else{
	
	if(n[0]==9){
	a=1;
	}else{
	
	a=n[0];
	}}
	
	if(n[1]==1){
	b=9;
	}else
	
	if(n[1]==9){
	b=1;
	}else{
	
	b=n[1];
	}}

	if(n[2]==1){
	c=9;
	}else
	
	if(n[2]==9){
	c=1;
	}else{
	
	c=n[2];
	}}

	printf("%c%c%c",&a,&b,&c);
}

Compiler output:
main.c:36:9: error: expected identifier or '(' before 'if'
   36 |         if(n[2]==1){
      |         ^~
main.c:38:10: error: expected identifier or '(' before 'else'
   38 |         }else
      |          ^~~~
main.c:42:10: error: expected identifier or '(' before 'else'
   42 |         }else{
      |          ^~~~
main.c:45:10: error: expected identifier or '(' before '}' token
   45 |         }}
      |          ^
main.c:47:16: error: expected declaration specifiers or '...' before string constant
   47 |         printf("%c%c%c",&a,&b,&c);
      |                ^~~~~~~~
main.c:47:25: error: expected declaration specifiers or '...' before '&' token
   47 |         printf("%c%c%c",&a,&b,&c);
      |                         ^
main.c:47:28: error: expected declaration specifiers or '...' before '&' token
   47 |         printf("%c%c%c",&a,&b,&c);
      |                            ^
main.c:47:31: error: expected declaration specifiers or '...' before '&' token
   47 |         printf("%c%c%c",&a,&b,&c);
      |                               ^
main.c:48:1: error: expected identifier or '(' before '}' token
   48 | }
      | ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
    string n; cin >> n;
    for(int i=0; i < 3; i++){
    if(n[i] == "1") cout << "9";
    else if(n[i] == "9") cout << "1";
    else cout << n[i];
    }
    cout << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:13: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    6 |     if(n[i] == "1") cout << "9";
a.cc:7:18: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
    7 |     else if(n[i] == "9") cout << "1";
Language: C

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

int main()
{

	char n[4];
	char a;
	char b;
	char c;
	
	scanf("%s",&n);

	if(n[0]==1){
	a=9;
	}else{
	
	if(n[0]==9){
	a=1;
	}else{
	
	a=n[0];
	}}
	
	if(n[1]==1){
	b=9;
	}else
	
	if(n[1]==9){
	b=1;
	}else{
	
	b=n[1];
	}}

	if(n[3]==1){
	c=9;
	}else{
	
	if(n[3]==9){
	c=1;
	}else{
	
	c=n[3];
	}}

	printf("%c%c%c",&a,&b,&c);
}

Compiler output:
main.c:36:9: error: expected identifier or '(' before 'if'
   36 |         if(n[3]==1){
      |         ^~
main.c:38:10: error: expected identifier or '(' before 'else'
   38 |         }else{
      |          ^~~~
main.c:47:16: error: expected declaration specifiers or '...' before string constant
   47 |         printf("%c%c%c",&a,&b,&c);
      |                ^~~~~~~~
main.c:47:25: error: expected declaration specifiers or '...' before '&' token
   47 |         printf("%c%c%c",&a,&b,&c);
      |                         ^
main.c:47:28: error: expected declaration specifiers or '...' before '&' token
   47 |         printf("%c%c%c",&a,&b,&c);
      |                            ^
main.c:47:31: error: expected declaration specifiers or '...' before '&' token
   47 |         printf("%c%c%c",&a,&b,&c);
      |                               ^
main.c:48:1: error: expected identifier or '(' before '}' token
   48 | }
      | ^
Language: C++

#include<map>
#include<vector>
using namespace std;
int main()
{
    int a[44],b[44];
    for(int i=0;i<3;i++){
        cin>>a[i];
    }
    for(int i=0;i<3;i++){
        if(a[i]==1)
        b[i]=9;
        if(a[i]==9)
        b[i]==1;
    }
    cout<<b[0]<<b[1]<<b[2];
    return 0;
}


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

using namespace std;
int main() {
    string n;
    cin >> n;
    for (auto &a : n) {
        if (a == '1') {
            cout << 9;
        } else {
            cout << 1;
        }
    }
    cout << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:3:5: error: 'string' was not declared in this scope
    3 |     string n;
      |     ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | using namespace std;
a.cc:4:5: error: 'cin' was not declared in this scope
    4 |     cin >> n;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:4:12: error: 'n' was not declared in this scope
    4 |     cin >> n;
      |            ^
a.cc:7:13: error: 'cout' was not declared in this scope
    7 |             cout << 9;
      |             ^~~~
a.cc:7:13: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:9:13: error: 'cout' was not declared in this scope
    9 |             cout << 1;
      |             ^~~~
a.cc:9:13: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:12:5: error: 'cout' was not declared in this scope
   12 |     cout << endl;
      |     ^~~~
a.cc:12:5: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:12:13: error: 'endl' was not declared in this scope
   12 |     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 | using namespace std;
Language: C

#include <stdio.h>
int main(){
  
    int a, n;
  
    scanf("%d", &n);
  
    if (n == 111){
       a = 999;
    }
  
    else if (n == 119){
       a = 991;
    }
  
    else if (n == 199){
       a = 911;
    }
  
    else if (n == 999){
       a = 111;
    }
  
    else if (n == 991){
       a = 119;
    }

    else {
       a = 199;
    }
  
    printf("%d\n", a)
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:32:22: error: expected ';' before 'return'
   32 |     printf("%d\n", a)
      |                      ^
      |                      ;
   33 | return 0;
      | ~~~~~~
Language: C

#include <stdio.h>
int main(){
  
    int a, n;
  
    scanf("%d", &n);
  
    if (n = 111){
       a = 999;
    }
  
    else if (n = 119){
       a = 991;
    }
  
    else if (n = 199){
       a = 911;
    }
  
    else if (n = 999){
       a = 111;
    }
  
    else if (n = 991){
       a = 119;
    }

    else {
       a = 199;
    }
  
    printf("%d\n", a)
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:32:22: error: expected ';' before 'return'
   32 |     printf("%d\n", a)
      |                      ^
      |                      ;
   33 | return 0;
      | ~~~~~~
Language: C

#include <stdio.h>
int main(){
  
    int a, n;
  
    scanf("%d", &n);
  
    if (n = 111){
       a == 999;
    }
  
    else if (n = 119){
       a == 991;
    }
  
    else if (n = 199){
       a == 911;
    }
  
    else if (n = 999){
       a == 111;
    }
  
    else if (n = 991){
       a == 119;
    }

    else {
       a == 199;
    }
  
    printf("%d\n", a)
return 0;
}


Compiler output:
main.c: In function 'main':
main.c:32:22: error: expected ';' before 'return'
   32 |     printf("%d\n", a)
      |                      ^
      |                      ;
   33 | return 0;
      | ~~~~~~
Language: C++

#include<iostream>
#include<windows.h>
#include<cstring>
using namespace std;
int main()
{
	string n;
	cin>>n;
	for(int i=0;i<n.length();i++)
	{
		if(n[i]=='9')cout<<1;
		else if(n[i]=='1')cout<<9;
	}	
	return 0;
} 

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