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

#include<iostream>
#include<string>
using namespace std;
int main(){
    string str;
    string target = "753";
    int ans = 1000;
    cin >> str;
    for(int i=0;i<str.size()-2;i++){
        int cost=0;
        for(int j=0;j<3;j++){
            int sa = abs(str[i+j]-str[j]);
            if(j==0) sa*=100;
            else if(j==1)   sa*=10;
            cost+=sa;
        }
        ans = min(cost,min);
    }
    cout << ans << 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<stdio.h>

int main(void){
 int i,num,d;
 d=1000; 
 char s[10];
 scanf("%s",s);
 for(i=0;i<s.length-3;i++){
   num=(int)s[i]*100+(int)s[i+1]*10+(int)s[i+2];
   if(d>num){
      d=num;
   }
 }
  printf("%d",d);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:8:13: error: request for member 'length' in something not a structure or union
    8 |  for(i=0;i<s.length-3;i++){
      |             ^
Language: C++

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

int main(){
	string S;
	cin >> S;
	int ans = 1000;
	int N = size(S);
	for (i=0;i<N-2;i++){
		string sub = substr(i,3);
		int a = atoi(sub.c_str());
		int b;
		if (a < 753)
			b = 753 - a;
		else
			b = a - 753;
		if (ans > b)
			ans = b;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: 'i' was not declared in this scope
   10 |         for (i=0;i<N-2;i++){
      |              ^
a.cc:11:30: error: 'substr' was not declared in this scope; did you mean 'strstr'?
   11 |                 string sub = substr(i,3);
      |                              ^~~~~~
      |                              strstr
Language: C++

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

int main(){
	string S;
	cin >> S;
	int ans = 1000;
	int N = size(S);
	for (i=0;i<N-2;i++){
		string sub = substr(i,3);
		int a = 100 * atoi(substr(i,1)) + 10 * atoi(substr(i+1,1)) + atoi(substr(i,1));
		int b;
		if (a < 753)
			b = 753 - a;
		else
			b = a - 753;
		if (ans > b)
			ans = b;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:14: error: 'i' was not declared in this scope
   10 |         for (i=0;i<N-2;i++){
      |              ^
a.cc:11:30: error: 'substr' was not declared in this scope; did you mean 'strstr'?
   11 |                 string sub = substr(i,3);
      |                              ^~~~~~
      |                              strstr
Language: C++

#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <iomanip>
#define rep(i,n) Rep(i,0,n)
#define Rep(i,k,n) for(int i=k ; i<n ; i++)
#define rep1(i,n) for(int i=1 ; i<=n ; i++)
#define vi vector<int>
#define Sort(v) sort(v.begin(),v.end())
#define Reverse(v) reverse(v.begin(),v.end())

//const int MOD = 1000000007;
//const int INF = 1<<30;
using namespace std;

string yn(bool x){
    return x ? "YES" : "NO";
}

int main(){
    string s; cin >> s;
    
    int dif = 10000;
    
    rep(i,s.length()-3){
    	a = s[i]-'0';
    	b = s[i+1]-'0';
    	c = s[i+2]-'0';
    	
    	int x = 100*a + 10*b + c;
    	
    	if(abs(753-x)<dif) {
    		dif = abs(753-x);
    	}
    }
    
    cout << dif << endl;
}









Compiler output:
a.cc: In function 'int main()':
a.cc:27:9: error: 'a' was not declared in this scope
   27 |         a = s[i]-'0';
      |         ^
a.cc:28:9: error: 'b' was not declared in this scope
   28 |         b = s[i+1]-'0';
      |         ^
a.cc:29:9: error: 'c' was not declared in this scope
   29 |         c = s[i+2]-'0';
      |         ^
Language: C++

#include <iostream>
using namespace std;

int main(){
  int num[20]
  int input_num;
  cin >> input_num;
  int i=0;
  while(input_num !=0){
  	num[i] = input_num%10;
  	input_num = (input_num - num[i])/10;
  	i++;
  }
  int min;
  min = 999999;
  int hoge;
  for(int j=0;j < i-2;j++){
    hoge = 753 - (num[i-1-j]+num[i-2-j]*10+num[i-3-j]*100);
    if(hoge < 0)hoge = hoge*(-1);
    if(hoge < min)min = hoge;
  }
  cout << min<< endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'int'
    6 |   int input_num;
      |   ^~~
a.cc:7:10: error: 'input_num' was not declared in this scope
    7 |   cin >> input_num;
      |          ^~~~~~~~~
a.cc:10:9: error: 'num' was not declared in this scope; did you mean 'enum'?
   10 |         num[i] = input_num%10;
      |         ^~~
      |         enum
a.cc:18:19: error: 'num' was not declared in this scope; did you mean 'enum'?
   18 |     hoge = 753 - (num[i-1-j]+num[i-2-j]*10+num[i-3-j]*100);
      |                   ^~~
      |                   enum
Language: C++

#include <iostream>
using namespace std;

int main(){
  int num[20]
  int input_num;
  cin >> input_num;
  int i=0;
  while(input_num !=0){
  	num[i] = input_num%10;
  	input_num = (input_num - num[i])/10;
  	i++
  }
  int min;
  min = 999999;
  int hoge;
  for(int j=0;j < i-2;j++){
    hoge = 753 - (num[i-1-j]+num[i-2-j]*10+num[i-3-j]*100);
    if(hoge < 0)hoge = hoge*(-1);
    if(hoge < min)min = hoge;
  }
  cout << min<< endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: expected initializer before 'int'
    6 |   int input_num;
      |   ^~~
a.cc:7:10: error: 'input_num' was not declared in this scope
    7 |   cin >> input_num;
      |          ^~~~~~~~~
a.cc:10:9: error: 'num' was not declared in this scope; did you mean 'enum'?
   10 |         num[i] = input_num%10;
      |         ^~~
      |         enum
a.cc:12:12: error: expected ';' before '}' token
   12 |         i++
      |            ^
      |            ;
   13 |   }
      |   ~         
a.cc:18:19: error: 'num' was not declared in this scope; did you mean 'enum'?
   18 |     hoge = 753 - (num[i-1-j]+num[i-2-j]*10+num[i-3-j]*100);
      |                   ^~~
      |                   enum
Language: Java

import java.util.*;
public class main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int L = s.length();
		String[] Num = s.split("");
		int[] num = new int[L];
		int min = 999;
		for(int i = 0; i < L; i++) {
			num[i] = Integer.parseInt(Num[i]);
		}
		for(int i = 0; i <= L-3; i++) {
			int sft = num[i]*100 + num[i+1]*10 + num[i+2];
			int dif = Math.abs(sft-753);
			min = Math.min(min, dif);
		}
		System.out.println(min);
	}
}

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

import java.util.Scanner;
public class main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		int L = s.length();
		String[] Num = s.split("");
		int[] num = new int[L];
		int min = 999;
		for(int i = 0; i < L; i++) {
			num[i] = Integer.parseInt(Num[i]);
		}
		for(int i = 0; i <= L-3; i++) {
			int sft = num[i]*100 + num[i+1]*10 + num[i+2];
			int dif = Math.abs(sft-753);
			min = Math.min(min, dif);
		}
		System.out.println(min);
		sc.close();
	}
}


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

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

int main() {
	string S;
	cin >> S;
	int ans=1000;
	for (int i = 0; i < S.size() - 2; i++) {
		int diff;
		diff = 753 - stoi(S.substr(i, 3));
		ans = min(ans, abs(diff));
	}
	cout << ans << endl;
	erturn 0;
}

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

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

int main(){
  string S;
  cin >> S;
  int N = S.size();
  int ans = 999;
  for (int i = 0; i <= N-3; i++){
    int num = (c[i] - '0') * 100 + (c[i-1] - '0') * 10 + (c[i-2] - '0') ;
    ans = min(ans, abs(num - 753)) ;
  }
  cout << ans << endl ;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:16: error: 'c' was not declared in this scope
   12 |     int num = (c[i] - '0') * 100 + (c[i-1] - '0') * 10 + (c[i-2] - '0') ;
      |                ^
Language: C

//header
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<ctype.h>
#include<stdlib.h>
#include<time.h>

//main
int main(void)
{
	int ary[11];
	int max;
	char st[11];
	int i = 0;
	scanf("%s", st);
	printf("%s", st);

	for (int i = 0; i < 8; i++) {
		ary[i] = st[i] - '0';
		ary[i+1] = st[i+1] - '0';
		ary[i+2] = st[i+2] - '0';
	
		if (i = 0) {
			max = 753 - abs(ary[i] * 100 + ary[i + 1] * 10 + ary[i + 2]);
		}
		else if (max < 753 - abs(ary[i] * 100 + ary[i + 1] * 10 + ary[i + 2])) {
			max = 753 - abs(ary[i] * 100 + ary[i + 1] * 10 + ary[i + 2]);
		}
	}
	printf("%d", max);

	return 0;


Compiler output:
main.c: In function 'main':
main.c:34:9: error: expected declaration or statement at end of input
   34 |         return 0;
      |         ^~~~~~
Language: C++

// ConsoleApplication1.cpp : アプリケーションのエントリ ポイントを定義します。
//

#include "stdafx.h"

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


int main() {
	int x[10] = {};
	int h = 753;
	std::string s;
	std::cin >> s;
	for (int i = 0; i<s.size(); i++) {
		x[i] = s[i]-'0';
	}

	for (int i = 0; i<11 && i<s.size()-2; i++) {
		if (abs(753 - (x[i] * 100 + x[i + 1] * 10 + x[i + 2]))<h) {
			h = abs(753 - (x[i] * 100 + x[i + 1] * 10 + x[i + 2]));
		}
	}

	std::cout << h;

	return 0;
}

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

#include <bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    cin>>s;
    int i,ans=10000;
    for(i=0;i<.size()-2;i++)
    {
        int t=(s[i]-'0')*100+(s[i+1]-'0')*10+(s[i+2]-'0');
        ans=min(ans,abs(753-t));
    }
    printf("%d",ans);
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:15: error: expected primary-expression before '.' token
    8 |     for(i=0;i<.size()-2;i++)
      |               ^
Language: C++

#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
int main()
{
  String S;
  cin >> S;
  int Ssize = S.size();
  int ans = 999;
  for(int i = 0;i <= Ssize -3;++i){
    int num= (S[i] - '0') * 100 + (S[i+1] - '0') * 10 + (S[i+2] - '0');
    ans = min(ans,abs(num - 753);
  }
  cout << ans;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:3: error: 'String' was not declared in this scope
    7 |   String S;
      |   ^~~~~~
a.cc:8:10: error: 'S' was not declared in this scope
    8 |   cin >> S;
      |          ^
a.cc:13:33: error: expected ')' before ';' token
   13 |     ans = min(ans,abs(num - 753);
      |              ~                  ^
      |                                 )
Language: C++

#include<bits/stdc++.h>
using namespace std;
int n[20],s;
int fc(int n1)
{
	int i;
	for(i=0;n1!=0;i++)
	{
		n[i]=n1%10;
		n1/=10;
	}
	return i;
}

int main()
{
	scanf("%d",&s);
	int t=fc(s);
	int min_=0;
	for(int i=t-3;i>=0;i--)
	{
		int f=a[i]*100+a[i+1]*10+a[i+2];
		if(abs(f-753)<abs(min_-753))
			min_=f;
	}
	printf("%d",min_);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:23: error: 'a' was not declared in this scope
   22 |                 int f=a[i]*100+a[i+1]*10+a[i+2];
      |                       ^
Language: C++

#include <iostream>
#include <string>
#include <regex>
#include <cmath>

using namespace std;

int main{
    string S;
    cin>>S;
    regex three ("[0-9]{3}")
    int dif=760;
   if(dif>sqrt( (753-three)*(753-three))){
       dif=sqrt( (753-three)*(753-three));
   }
   cout<<dif;
    return 0;
}

Compiler output:
a.cc:8:5: error: cannot declare '::main' to be a global variable
    8 | int main{
      |     ^~~~
a.cc:9:12: error: expected primary-expression before 'S'
    9 |     string S;
      |            ^
a.cc:9:12: error: expected '}' before 'S'
a.cc:8:9: note: to match this '{'
    8 | int main{
      |         ^
a.cc:10:5: error: 'cin' does not name a type
   10 |     cin>>S;
      |     ^~~
a.cc:12:5: error: expected ',' or ';' before 'int'
   12 |     int dif=760;
      |     ^~~
a.cc:13:4: error: expected unqualified-id before 'if'
   13 |    if(dif>sqrt( (753-three)*(753-three))){
      |    ^~
a.cc:16:4: error: 'cout' does not name a type
   16 |    cout<<dif;
      |    ^~~~
a.cc:17:5: error: expected unqualified-id before 'return'
   17 |     return 0;
      |     ^~~~~~
a.cc:18:1: error: expected declaration before '}' token
   18 | }
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
char a[10000];
int main()
{
	long long int n,m,k,i,j;
	long long c=INT_MAX;
	getchar();
	gets(a);
	for(i=0;i<strlen(a)-2;i++)
	{
		k=a[i]*100+a[i+1]*10+a[i+2];
		if(abs(k-753)<c)
		{
			c=abs(k-753);
		}
	}
	printf("%lld",c);
	return 0;
}

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

#include<bits/stdc++.h>
using namespace std;
char a[10000];
int main()
{
	int n,m,k,i,j;
	int c=INT_MAX;
	getchar();
	gets(a);
	for(i=0;i<strlen(a)-2;i++)
	{
		k=a[i]*100+a[i+1]*10+a[i+2];
		if(abs(k-753)<c)
		{
			c=abs(k-753);
		}
	}
	printf("%d",c);
	return 0;
}

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

// ConsoleApplication17.cpp : コンソール アプリケーションのエントリ ポイントを定義します。
//

#include "stdafx.h"
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
int ctoi(char c) {
	switch (c) {
	case '0': return 0;
	case '1': return 1;
	case '2': return 2;
	case '3': return 3;
	case '4': return 4;
	case '5': return 5;
	case '6': return 6;
	case '7': return 7;
	case '8': return 8;
	case '9': return 9;
	default: return 0;
	}
}
int main()
{
	int i;
	int ans;
	int fin_ans;
	i = 10;

	char str[100];
	
	std::cin >> str;
	fin_ans = 753;

	for (i = 0; i < 7;i++) {
		ans = (((ctoi(str[i]))*100) +  ((ctoi(str[i + 1]))*10) + (ctoi(str[i + 2])));
		//printf("%d\n,",ans);
		//printf("%d, %d, %d\n", ctoi(str[i]), ctoi(str[i+1]), ctoi(str[i+2]));
		ans = abs(753 - ans);
		if (fin_ans > ans) {
			fin_ans = ans;
		}

	}
	printf("%d", fin_ans);

    return 0;
}




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

#include<stdio.h>
#include<math.h>
int main()
{
int max=0,i;
char a[10];
while(1==scanf("%s",a))
{int x=0;
 
for(i=0;a[i]!='\0&&a[i+1]!='\0'&&a[i+2]!='\0'';i++)
{
x=abs(100*a[i]+10*a[i+1]+a[i+2]-753);
if(!x) break;
if(max<x)
max=x;}
printf("%d",max);
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:10:15: warning: multi-character literal with 11 characters exceeds 'int' size of 4 bytes
   10 | for(i=0;a[i]!='\0&&a[i+1]!='\0'&&a[i+2]!='\0'';i++)
      |               ^~~~~~~~~~~~~~
main.c:10:29: error: stray '\' in program
   10 | for(i=0;a[i]!='\0&&a[i+1]!='\0'&&a[i+2]!='\0'';i++)
      |                             ^
main.c:10:29: error: expected ';' before numeric constant
   10 | for(i=0;a[i]!='\0&&a[i+1]!='\0'&&a[i+2]!='\0'';i++)
      |                             ^~
      |                             ;
main.c:10:31: warning: multi-character literal with 10 characters exceeds 'int' size of 4 bytes
   10 | for(i=0;a[i]!='\0&&a[i+1]!='\0'&&a[i+2]!='\0'';i++)
      |                               ^~~~~~~~~~~~
main.c:10:43: error: stray '\' in program
   10 | for(i=0;a[i]!='\0&&a[i+1]!='\0'&&a[i+2]!='\0'';i++)
      |                                           ^
main.c:10:45: error: empty character constant
   10 | for(i=0;a[i]!='\0&&a[i+1]!='\0'&&a[i+2]!='\0'';i++)
      |                                             ^~
main.c:12:3: error: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
   12 | x=abs(100*a[i]+10*a[i+1]+a[i+2]-753);
      |   ^~~
main.c:3:1: note: include '<stdlib.h>' or provide a declaration of 'abs'
    2 | #include<math.h>
  +++ |+#include <stdlib.h>
    3 | int main()
Language: C++

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main()
{
    char x[15],a[6];
    int i,b,k=0,p;
    gets(x);
    for(i=0; x[i+2]!='\0'; i++)
    {
        if(k==0)
        {
            k++;
            a[0]=x[i];
            a[1]=x[i+1];
            a[2]=x[i+2];
            p=atoi(a);
        }
        if(k>0)
        {
            a[0]=x[i];
            a[1]=x[i+1];
            a[2]=x[i+2];
            b=atoi(a);
           if(abs(753-p)>abs(753-b))
                p=b;
        }

    }
    int res=abs(753-p);
    printf("%d\n",res);
    return 0;
}


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

#include<stdio.h>
#include<math.h>
int main()
{
int max=0,i;
cahr a[10];
while(1==scanf("%s",a))
{int x=0;

for(i=0;a[i]!='\0';i++)
{
x=abs(100*a[i]+10*a[i+1]+a[i+2]-753);
if(max<x)
max=x;}
printf("%d",max);
}
return 0;
}

Compiler output:
main.c: In function 'main':
main.c:6:1: error: unknown type name 'cahr'; did you mean 'char'?
    6 | cahr a[10];
      | ^~~~
      | char
main.c:12:3: error: implicit declaration of function 'abs' [-Wimplicit-function-declaration]
   12 | x=abs(100*a[i]+10*a[i+1]+a[i+2]-753);
      |   ^~~
main.c:3:1: note: include '<stdlib.h>' or provide a declaration of 'abs'
    2 | #include<math.h>
  +++ |+#include <stdlib.h>
    3 | int main()
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define INF 2147438647
#define nl '\n'
#define si(i) scanf("%d", &i);
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

string n;
int mi = INF;

int main(){
    cin >> n;
    int lnt = n.size();
    for( int i1 = 0 ;  i1 < lnt ; i1++ ){
        for( int i2 = i1 + 1 ; i2 < lnt  ; i2++ ){
            for( int i3 = i2 + 1 ; i3 < lnt ; i3++ ){
                int x = (int(s[i1]) - '0') * 100 + (int(s[i2]) - '0' ) * 10 + ( int(s[i3]) - '0');
                mi = min( abs(x - 753), mi);
            }
        }
    }
    cout << mi << nl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:30: error: 's' was not declared in this scope
   23 |                 int x = (int(s[i1]) - '0') * 100 + (int(s[i2]) - '0' ) * 10 + ( int(s[i3]) - '0');
      |                              ^
Language: C++

#include<iostream>
#include <bits/stdc++.h>
#include <stdlib.h>
using namespace std;
int ctoi(char c){
switch(c){
  case '0': return 0;
  case '1': return 1;
  case '2': return 2;
  case '3': return 3;
  case '4': return 4;
  case '5': return 5;
  case '6': return 6;
  case '7': return 7;
  case '8': return 8;
  case '9': return 9;
  default : return -1;
}
}

int main() {
  char a[10];
  int b[11];
  int d[8];
  
  for(int i = 0;i<10;i++){
    cin >> a[i];
  }
  for(int i = 0;i<11;i++){
    b[i] = ctoi(a[i]);
  }
  for(int i = 0;i < 8;i++){
    if(b[i+2] != 1||b[i+2] != 2||b[i+2] != 3||b[i+2] != 4||b[i+2] != 5||b[i+2] != 6||b[i+2] != 7||b[i+2] != 8||b[i+2] != 9||){
      d[i] = 0;
    }
    d[i] = b[i]*100+b[i+1]*10+b[i+2]*1;
  }
  int e = abs(d[0]-753);
  for(int i = 1;i<8;i++){
    
    if(e > abs(d[i]-753)){
      e = abs(d[i]-753);
    }
  }
  cout << e << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:125: error: expected primary-expression before ')' token
   33 |     if(b[i+2] != 1||b[i+2] != 2||b[i+2] != 3||b[i+2] != 4||b[i+2] != 5||b[i+2] != 6||b[i+2] != 7||b[i+2] != 8||b[i+2] != 9||){
      |                                                                                                                             ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define INF 2147438647
#define nl '\n'
#define si(i) scanf("%d", &i);
typedef long long ll;
typedef pair<int, int> pii;
typedefe vector<int> vi;

string n;
int mi = INF;

int main(){
    cin >> n;
    int lnt = n.size();
    for( int i1 = 0 ;  i1 < lnt ; i1++ ){
        for( int i2 = i1 + 1 ; i2 < lnt  ; i2++ ){
            for( int i3 = i2 + 1 ; i3 < lnt ; i3++ ){
                int x = (int(s[i1]) - '0') * 100 + (int(s[i2]) - '0' ) * 10 + ( int(s[i3]) - '0));
                mi = min( abs(x - 753), mi);
            }
        }
    }
    cout << mi << nl;
}


Compiler output:
a.cc:23:94: warning: missing terminating ' character
   23 |                 int x = (int(s[i1]) - '0') * 100 + (int(s[i2]) - '0' ) * 10 + ( int(s[i3]) - '0));
      |                                                                                              ^
a.cc:23:94: error: missing terminating ' character
   23 |                 int x = (int(s[i1]) - '0') * 100 + (int(s[i2]) - '0' ) * 10 + ( int(s[i3]) - '0));
      |                                                                                              ^~~~~
a.cc:12:1: error: 'typedefe' does not name a type; did you mean 'typedef'?
   12 | typedefe vector<int> vi;
      | ^~~~~~~~
      | typedef
a.cc: In function 'int main()':
a.cc:23:30: error: 's' was not declared in this scope
   23 |                 int x = (int(s[i1]) - '0') * 100 + (int(s[i2]) - '0' ) * 10 + ( int(s[i3]) - '0));
      |                              ^
a.cc:24:44: error: expected ')' before ';' token
   24 |                 mi = min( abs(x - 753), mi);
      |                                            ^
      |                                            )
a.cc:23:79: note: to match this '('
   23 |                 int x = (int(s[i1]) - '0') * 100 + (int(s[i2]) - '0' ) * 10 + ( int(s[i3]) - '0));
      |                                                                               ^
Language: C

#include <stdio.h>

//using namespace std;

int main() {
	int s;
	scanf("%d",&s);
	
	int s_array[10]={};
	int disit =10;
	
	for(int i=0; i<10 ; i++){
		// disit = std::pow(10,i+1);
		s_array[9-i] = s % disit;
		s = s / disit;
	}
	
	// for(int i=0; i<10; i++){
	// 	cout << s_array[i] << endl;
	// }
	
	int corr = 10000;
	
	int runrun;
	for(int i=0; i<8; i++){
		if(s_array[i]==0){
			continue;
		}
		runrun = 100*s_array[i]+10*s_array[i+1]+s_array[i+2];
		if(corr> std::abs(753-runrun)){
			corr = std::abs(753-runrun);
			// cout << runrun << "\n" << corr << endl<<endl;
		}
	}
	printf("%d",corr);
	
	return 0;
}

Compiler output:
main.c: In function 'main':
main.c:30:26: error: 'std' undeclared (first use in this function)
   30 |                 if(corr> std::abs(753-runrun)){
      |                          ^~~
main.c:30:26: note: each undeclared identifier is reported only once for each function it appears in
main.c:30:29: error: expected ')' before '::' token
   30 |                 if(corr> std::abs(753-runrun)){
      |                   ~         ^~
      |                             )
main.c:31:35: error: expected ';' before '::' token
   31 |                         corr = std::abs(753-runrun);
      |                                   ^~
      |                                   ;
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define INF 2147438647
#define nl '\n'
#define si(i) scanf("%d", &i);
typedef long long ll;
typedef pair<int, int> pii;
typdefe vector<int> vi;

string n;
int mi = INF;

int main(){
    cin >> n;
    int lnt = n.size();
    for( int i1 = 0 ;  i1 < lnt ; i1++ ){
        for( int i2 = i1 + 1 ; i2 < lnt  ; i2++ ){
            for( int i3 = i2 + 1 ; i3 < lnt ; i3++ ){
                int x = (int(s[i1]) - '0') * 100 + (int(s[i2] - '0' ) * 10 + ( int(s[i3] - '0));
                mi = min( abs(x - 753), mi);
            }
        }
    }
    cout << mi << nl;
}


Compiler output:
a.cc:23:92: warning: missing terminating ' character
   23 |                 int x = (int(s[i1]) - '0') * 100 + (int(s[i2] - '0' ) * 10 + ( int(s[i3] - '0));
      |                                                                                            ^
a.cc:23:92: error: missing terminating ' character
   23 |                 int x = (int(s[i1]) - '0') * 100 + (int(s[i2] - '0' ) * 10 + ( int(s[i3] - '0));
      |                                                                                            ^~~~~
a.cc:12:1: error: 'typdefe' does not name a type; did you mean 'typedef'?
   12 | typdefe vector<int> vi;
      | ^~~~~~~
      | typedef
a.cc: In function 'int main()':
a.cc:23:30: error: 's' was not declared in this scope
   23 |                 int x = (int(s[i1]) - '0') * 100 + (int(s[i2] - '0' ) * 10 + ( int(s[i3] - '0));
      |                              ^
a.cc:24:44: error: expected ')' before ';' token
   24 |                 mi = min( abs(x - 753), mi);
      |                                            ^
      |                                            )
a.cc:23:78: note: to match this '('
   23 |                 int x = (int(s[i1]) - '0') * 100 + (int(s[i2] - '0' ) * 10 + ( int(s[i3] - '0));
      |                                                                              ^
a.cc:24:44: error: expected ')' before ';' token
   24 |                 mi = min( abs(x - 753), mi);
      |                                            ^
      |                                            )
a.cc:23:52: note: to match this '('
   23 |                 int x = (int(s[i1]) - '0') * 100 + (int(s[i2] - '0' ) * 10 + ( int(s[i3] - '0));
      |                                                    ^
Language: C++

#include <stdio.h>

//using namespace std;

int main() {
	int s;
	scanf("%d",&s);
	
	int s_array[10]={};
	int disit =10;
	
	for(int i=0; i<10 ; i++){
		// disit = std::pow(10,i+1);
		s_array[9-i] = s % disit;
		s = s / disit;
	}
	
	// for(int i=0; i<10; i++){
	// 	cout << s_array[i] << endl;
	// }
	
	int corr = 10000;
	
	int runrun;
	for(int i=0; i<8; i++){
		if(s_array[i]==0){
			continue;
		}
		runrun = 100*s_array[i]+10*s_array[i+1]+s_array[i+2];
		if(corr> std::abs(753-runrun)){
			corr = std::abs(753-runrun);
			// cout << runrun << "\n" << corr << endl<<endl;
		}
	}
	printf("%d",corr);
	
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:30:31: error: 'abs' is not a member of 'std'
   30 |                 if(corr> std::abs(753-runrun)){
      |                               ^~~
a.cc:31:37: error: 'abs' is not a member of 'std'
   31 |                         corr = std::abs(753-runrun);
      |                                     ^~~
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
using namespace std;

int main(){
  char N[11];
  int S[11]={};
  int K;
  int i=0;
  int num[10];
  int ans= 1000;
  int AAa=1000;
  int aAA=0, AAA;


  scanf("%s", N);
  do{
    S[i] = N[i]-48;
    i++;
  }  while(N[i]);


  for(int l=0;l<i-2;l++){
  	K=fabs(753-S[l]*100 - S[l+1]*10 - S[l+2]);
  	ans = min(ans, K);
    printf("%d\n", K);
  }


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

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

#include "bits/stdc++.h"
#define rep(i,a,n) for(int i=a;i<n;i+=2)
using namespace std;
int main(){
  int n;cin>>n;
  int ans=10000000;
  while(n>0){
    if(ans>abs(753-n%1000))ans=(n%1000-753);
    n/=10;
  }
  cout<<ans<<endl;

Compiler output:
a.cc: In function 'int main()':
a.cc:11:19: error: expected '}' at end of input
   11 |   cout<<ans<<endl;
      |                   ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C

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

int main(void){
	char buf[64];
	int num=strlen(buf)-2;
	int i;
	int h = 10;
	int h1 = 10;
	int m1 = 10;
	int l1 = 10;
	int l = 10;
	int val;
	int m = 10;

	scanf_s("%s",buf);

	for(i=0;i<strlen(buf)-2;i++){
		val = abs(7-(buf[i]-'0'));
		if(h > val){
			h = val;
			num = i;
			h1 = buf[i]-'0';
		}
	}
	printf("%d\n",h);

	for(i=num+1;i<strlen(buf)-1;i++){
		val = abs(5-(buf[i]-'0'));
		if(m > val){
			m = val;
			num = i;
			m1 = buf[i]-'0';
		}
	}

	for(i=num+1;i<strlen(buf);i++){
		val = abs(3-(buf[i]-'0'));
		if(l > val){
			l = val;
			l1 = buf[i]-'0';
		}
	}

	printf("%d",abs(753-(h1*100+m1*10+l1)));

	return 0;
}



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

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
int zyo(int n){
    int a=1;
    for(int i=1;i<n;i++){
        a=a*10;
    }
    return a;
}
int main(){
    int n;
    cin>>n;
    int ans=1000000;
    int s[10];
    int c=8;
    for(int i=0;i<c;i++){
        int a,b;
        b==zyo(i);
        a=b*100;
        if(n/b==0) {
            c=i;
            break;
        }
        s[i]=(n%a)/b;
    }
    for(int i=0;i<c;i++){
        int d;
        d=753-s[i];
        if(d<0)b=-d;
        if(ans<d)ans=d;
     }
    cout <<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:16: error: 'b' was not declared in this scope
   32 |         if(d<0)b=-d;
      |                ^
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
int zyo(int n){
    int a=1;
    for(int i=1;i<n;i++){
        a=a*10;
    }
    return a;
}
int main(){
    int n;
    cin>>n;
    int ans=1000000;
    int s[10];
    int c=8;
    for(int i=0;i<c;i++){
        int a,b;
        b==zyo(i);
        a=b*100;
        if(n/b=0) {
            c=i;
            break;
        }
        s[i]=(n%a)/b;
    }
    for(int i=0;i<c;i++){
        int d;
        d=753-s[i];
        if(b<0)b=-d;
        if(ans<b)ans=d;
     }
    cout <<ans<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:23:13: error: lvalue required as left operand of assignment
   23 |         if(n/b=0) {
      |            ~^~
a.cc:32:12: error: 'b' was not declared in this scope
   32 |         if(b<0)b=-d;
      |            ^
a.cc:33:16: error: 'b' was not declared in this scope
   33 |         if(ans<b)ans=d;
      |                ^
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
int zyo(int n){
    int a=1;
    for(int i=1;i<n;i++){
        a=a*10;
    }
    return a;
}
int main(){
    int n;
    cin>>n;
    int ans=1000000;
    int s[10];
    int c=8;
    for(int i=0;i<c;i++){
        int a,b;
        b=zyo(i);
        a=b*100;
        if(n/b=0) {
            c=i;
            break;
        }
        s[i]=(n%a)/b;
    }
    for(int i=0;i<c;i++){
        b=753-s[i];
        if(b<0)b=-b;
        if(ans<b)ans=b;
     }
    cout <<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:13: error: lvalue required as left operand of assignment
   23 |         if(n/b=0) {
      |            ~^~
a.cc:30:9: error: 'b' was not declared in this scope
   30 |         b=753-s[i];
      |         ^
Language: C++

#include <iostream>
#include <cstring>
#include <algorithm>
#include <string> 
#include <cmath>
using namespace std;
const int maxl=10000000;
char a[maxl];
int cpy[maxl];
int main()
{
	memset(a,0,sizeof(a));
	gets(a);
	for(int i=0;i<strlen(a)-2;i++)
	{
			cpy[i]=abs(753-((a[i]-48)*100+(a[i+1]-48)*10+a[i+2]-48));
	}
	int l=strlen(a)-2;
	sort(cpy,cpy+l);
	
	cout<<cpy[0];
	return 0;
}

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

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

int main(void){
	char buf[64];
	scanf("%s",buf);

	int num=strlen(buf)-2;
	int i;
	int h = 10;
	int h1 = 10;
	int m1 = 10;
	int l1 = 10;
	int val;
	for(i=0;i<strlen(buf)-2;i++){
		val = abs(7-(buf[i]-'0'));
		if(h > val){
			h = val;
			num = i;
			h1 = buf[i]-'0';
		}
	}
	printf("%d\n",h);

	int m = 10;
	for(i=num+1;i<strlen(buf)-1;i++){
		val = abs(5-(buf[i]-'0'));
		if(m > val){
			m = val;
			num = i;
			m1 = buf[i]-'0';
		}
	}

	int l = 10;
	for(i=num+1;i<strlen(buf);i++){
		val = abs(3-(buf[i]-'0'));
		if(l > val){
			l = val;
			l1 = buf[i]-'0';
		}
	}

	printf("%d",abs(753-(h1*100+m1*10+l1)));

	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:16:23: error: 'abs' was not declared in this scope
   16 |                 val = abs(7-(buf[i]-'0'));
      |                       ^~~
a.cc:27:23: error: 'abs' was not declared in this scope
   27 |                 val = abs(5-(buf[i]-'0'));
      |                       ^~~
a.cc:37:23: error: 'abs' was not declared in this scope
   37 |                 val = abs(3-(buf[i]-'0'));
      |                       ^~~
a.cc:44:21: error: 'abs' was not declared in this scope
   44 |         printf("%d",abs(753-(h1*100+m1*10+l1)));
      |                     ^~~
Language: C++

#include<stdio.h>
#include<math.h>
#include<string.h>
int main()
{
    int n,i,j,k,b[10];
    char a[10];
    while(gets(a)!=NULL)
    {
        k=strlen(a);
        for(i=0;i<k-2;i++)
        {
            b[i]=(a[i]-48)*100+(a[i+1]-48)*10+a[i+2]-48;
        }
        for(j=0;j<k-2;j++)
        {
            b[j]=fabs((double)(b[j]-753));
        }
        i=b[0];
        for(j=0;j<k-2;j++)
        {
            if(i>b[j])
                i=b[j];
        }
        printf("%d\n",i);
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: 'gets' was not declared in this scope; did you mean 'getw'?
    8 |     while(gets(a)!=NULL)
      |           ^~~~
      |           getw
Language: C++

#include<stdio.h>
#include<math.h>
#include<string.h>
int main()
{
    int n,i,j,k,b[10];
    char a[10];
    while(gets(a)!=NULL)
    {
        k=strlen(a);
        for(i=0;i<k-2;i++)
        {
            b[i]=(a[i]-48)*100+(a[i+1]-48)*10+a[i+2]-48;
        }
        for(j=0;j<k-2;j++)
        {
            b[j]=fabs((double)(b[j]-753));
        }
        i=b[0];
        for(j=0;j<k-2;j++)
        {
            if(i>b[j])
                i=b[j];
        }
        printf("%ld\n",i);
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: 'gets' was not declared in this scope; did you mean 'getw'?
    8 |     while(gets(a)!=NULL)
      |           ^~~~
      |           getw
Language: C++

#include<iostream>
#include<cmath>
#include<cstdlib>
#include<string>
#include<string.h>
#include<math.h>
using namespace std;


int main(){
    char str[100];
    string three;
    int min,gap,length;
    min=1000;
    gets(str);
    length=strlen(str);
    //cout<<"length="<<length<<endl;
    int i=0;
    do{ 
        //three="\0";
        //cout<<str[i]<<endl;
        three = str[i];
        three +=str[i+1];
        three += str[i+2];
        //cout<<"three="<<three<<endl;
        auto num=std::atoi(three.c_str());
        gap=abs(753-num);
        if(gap<min){min=gap;}
        i++;
    }while(i+3<=length);
    cout<<min;
    return 0;
}

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

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

int main() {
  int s;
  cin >> s;
  vector<int> x;
  vector<int> xx;
  for (int i = 0; i < s.size(); i++) {
    x[i] = (100 * s[i]) + (10 * s[i+1]) + s[i+2];
    xx[i] = abs(753 - x[i]);
  }
  sort(xx.begin(), xx.end());
  cout << xx[0] << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:25: error: request for member 'size' in 's', which is of non-class type 'int'
   11 |   for (int i = 0; i < s.size(); i++) {
      |                         ^~~~
a.cc:12:20: error: invalid types 'int[int]' for array subscript
   12 |     x[i] = (100 * s[i]) + (10 * s[i+1]) + s[i+2];
      |                    ^
a.cc:12:34: error: invalid types 'int[int]' for array subscript
   12 |     x[i] = (100 * s[i]) + (10 * s[i+1]) + s[i+2];
      |                                  ^
a.cc:12:44: error: invalid types 'int[int]' for array subscript
   12 |     x[i] = (100 * s[i]) + (10 * s[i+1]) + s[i+2];
      |                                            ^
Language: C++

#include <iostream>
#include <cstdlib>
#include <cmath>
 
using namespace std;
 
int get_three_num(string str, int index);
int calc_sub(int num);
 
int main(void)
{
  string str;
  int closest_num;
  int current_num;
  
  cin >> str;
  
  closest_num = get_three_num(str, 0);
  for(int i = 1; i < str.length() - 2; i++){
    current_num = get_three_num(str, i);
    
    if(calc_sub(closest_num) > calc_sub(current_num)){
      closest_num = current_num;
    }
  }
  
  cout << closest_num;
  
  return 0;
}
 
int get_three_num(string str, int index)
{
  int num = 0;
  
  for(int i = index; i < index + 3; i++){
    num += (str[i] - '0') * pow(10, 2 - (i - index));
  }
  
  return (int)num;
}
 
int calc_sub(int num)
{
  return abs(753 - num);
}

int calc_sub(int num)
{
  return abs(753 - num);
}


Compiler output:
a.cc:48:5: error: redefinition of 'int calc_sub(int)'
   48 | int calc_sub(int num)
      |     ^~~~~~~~
a.cc:43:5: note: 'int calc_sub(int)' previously defined here
   43 | int calc_sub(int num)
      |     ^~~~~~~~
Language: C++

#include<stdio.h>
#include<stdlib.h>
int main()
{
    const value = 753;
    int s, a[10], i, result, dif = 0;
    scanf("%d", &s);
    for(i = 0, s != 0, i++)
    {
        a[i] = s % 10;
        s /= 10;
    }
    for(int j = 0, j <= i - 2, j++)
    {
        result = a[j] + a[j + 1] * 10 + a[j + 2] * 100;
        if(dif < abs(result - value))
        {
            dif = abs(result - value);
        }
    }
    printf("%d", dif);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:5:11: error: 'value' does not name a type
    5 |     const value = 753;
      |           ^~~~~
a.cc:8:27: error: expected ';' before ')' token
    8 |     for(i = 0, s != 0, i++)
      |                           ^
      |                           ;
a.cc:13:5: error: expected primary-expression before 'for'
   13 |     for(int j = 0, j <= i - 2, j++)
      |     ^~~
a.cc:12:6: error: expected ';' before 'for'
   12 |     }
      |      ^
      |      ;
   13 |     for(int j = 0, j <= i - 2, j++)
      |     ~~~
a.cc:13:5: error: expected primary-expression before 'for'
   13 |     for(int j = 0, j <= i - 2, j++)
      |     ^~~
a.cc:12:6: error: expected ')' before 'for'
   12 |     }
      |      ^
      |      )
   13 |     for(int j = 0, j <= i - 2, j++)
      |     ~~~
a.cc:8:8: note: to match this '('
    8 |     for(i = 0, s != 0, i++)
      |        ^
a.cc:13:21: error: expected ';' before '<=' token
   13 |     for(int j = 0, j <= i - 2, j++)
      |                     ^~~
      |                     ;
a.cc:13:22: error: expected primary-expression before '<=' token
   13 |     for(int j = 0, j <= i - 2, j++)
      |                      ^~
a.cc:13:35: error: expected ';' before ')' token
   13 |     for(int j = 0, j <= i - 2, j++)
      |                                   ^
      |                                   ;
a.cc:16:31: error: 'value' was not declared in this scope
   16 |         if(dif < abs(result - value))
      |                               ^~~~~
Language: C++

#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
    char s[10];
    gets(s);
    int i,sum,min=10000,max;
    int n=strlen(s);
    for(i=0;i<=n-3;i++)
    {
        sum=(s[i]-'0')*100+(s[i+1]-'0')*10+s[i+2]-'0';
        max=fabs((int)sum-753);
        if(max<min)
            min=max;
    }
    printf("%d\n",min);
    return 0;
}


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

#include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
    char s[10];
    gets(s);
    int i,sum,min=10000,max;
    int n=strlen(s);
    for(i=0;i<=n-3;i++)
    {
        sum=(s[i]-'0')*100+(s[i+1]-'0')*10+s[i+2]-'0';
        max=fabs((int)sum-753);
        if(max<min)
            min=max;
    }
    printf("%d",min);
    return 0;
}


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

#include<bits/stdc++.h>
using namespace std;
char tmp[1000];
int a[1000];
int main()
{
	int n,tmp1,i,j,k,ans=999;
	gets(tmp);
	n=strlen(tmp); 
	for(i=0;i<n;i++)
	{
		a[i]=tmp[i]-'0';
	}
	for(i=0;i<n-2;i++)
	{
		ans=min(ans,abs(a[i]*100+a[i+1]*10+a[i+2]-753));
	}
	printf("%d",ans);
	return 0;
} 

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

#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main()
{
    char x[15],a[6];
    int i,b,k=0,p;
    gets(x);
    for(i=0; x[i]!='\0'; i++)
    {
        if(x[i]=='7' && k==0)
        {
            k++;
            a[0]=x[i];
            a[1]=x[i+1];
            a[2]=x[i+2];
            p=atoi(a);
        }
        if(x[i]=='7' && k>0)
        {
            a[0]=x[i];
            a[1]=x[i+1];
            a[2]=x[i+2];
            b=atoi(a);
            if(753-p>753-b)
                p=b;
        }

    }

    int res=753-p;
    if(res<0)res=res*-1;
    printf("%d\n",res);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'gets' was not declared in this scope; did you mean 'getw'?
    8 |     gets(x);
      |     ^~~~
      |     getw
Language: Java

import java.util.*;
import java.lang.Math;
import java.io.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    String x = sc.next();
	String[] xArray = new String[x.length()];
    int[] c = new int[xArray.length -2];
    
	for(int i = 0;i < x.length(); i++){
      xArray[i] = String.valueOf(x.charAt(i));
    }
    
    int scg = 753;
    for(int i = 0;i < xArray.length - 2;i++){
      c[i] = Math.abs(Integer.parseInt(xArray[i] + xArray[i + 1] + xArray[i + 2]) - sichigo);
    }
    
    int min = 1000;
    for(int i = 0; i < c.length;i++){
      min = Math.min(min,c[i]);
      System.out.println(min);
    }
  }
}

Compiler output:
Main.java:18: error: cannot find symbol
      c[i] = Math.abs(Integer.parseInt(xArray[i] + xArray[i + 1] + xArray[i + 2]) - sichigo);
                                                                                    ^
  symbol:   variable sichigo
  location: class Main
1 error
Language: C++

#include<bits/stdc++.h>
using namespace std;
char tmp[11];
int a[11];
int main()
{
	int n,tmp1,i,j,k,ans=999;
	gets(tmp);
	n=strlen(tmp); 
	for(i=0;i<n;i++)
	{
		a[i]=tmp[i]-'0';
	}
	for(i=0;i<n-2;i++)
	{
		ans=min(ans,abs(a[i]*100+a[i+1]*10+a[i+2]-753));
	}
	printf("%d",ans);
	return 0;
} 

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

#include<bits/stdc++.h>
using namespace std;
char tmp[11];
int a[11];
int main()
{
	int n,tmp1,i,j,k,ans=999;
	gets(tmp);
	n=strlen(tmp); 
	for(i=0;i<n;i++)
	{
		a[i]=tmp[i]-'0';
	}
	for(i=0;i<n-2;i++)
	{
		for(j=i+1;j<n-1;j++)
		{
			for(k=j+1;k<n;k++)
			{
				ans=min(ans,abs(a[i]*100+a[j]*10+a[k]-753));
			}
		}
	}
	printf("%d",ans);
	return 0;
} 

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

#include <iostream>
#include <cstdlib>

using namespace std;

int get_three_num(string str, int index);
int calc_sub(int num);

int main(void)
{
  string str;
  int closest_num;
  int current_num;
  
  cin >> str;
  
  closest_num = get_three_num(str, 0);
  for(int i = 1; i < str.length() - 2; i++){
    current_num = get_three_num(str, i);
    
    if(calc_sub(closest_num) > calc_sub(current_num)){
      closest_num = current_num;
    }
  }
  
  cout << closest_num;
  
  return 0;
}

int get_three_num(string str, int index)
{
  int num;
  
  for(i = index; i < index + 3; i++){
    num += pow(10, 2 - (i - index));
  }
  
  return num;
}

int calc_sub(int num)
{
  return abs(753 - num);
}


Compiler output:
a.cc: In function 'int get_three_num(std::string, int)':
a.cc:35:7: error: 'i' was not declared in this scope
   35 |   for(i = index; i < index + 3; i++){
      |       ^
a.cc:36:12: error: 'pow' was not declared in this scope
   36 |     num += pow(10, 2 - (i - index));
      |            ^~~
Language: C++

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

using namespace std;

typedef long long int ll;
typedef long int li;

int main(void){
    ll ans;
    ll s;
    ans =100000;
    len = 3;
    cin >> s;
    
    while(s>110){
        ll x;
        x = s % 1000;
        s = s / 10;
        ans=min(ans,abs(x-753));
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:5: error: 'len' was not declared in this scope
   16 |     len = 3;
      |     ^~~
Language: C++

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

int main()
{
  char S[11], tmp[4];
  int min = 753, dif;
  scanf("%s", S);

  for (int i = 0; i < strlen(S) - 2; i++)
  {
    strncpy(tmp, S + i, 3);
    dif = abs(753 - atoi(tmp));
    if (min >= dif)
    {
      min = dif;
    }
  }

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

Compiler output:
a.cc: In function 'int main()':
a.cc:11:23: error: 'strlen' was not declared in this scope
   11 |   for (int i = 0; i < strlen(S) - 2; i++)
      |                       ^~~~~~
a.cc:3:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    2 | #include <string>
  +++ |+#include <cstring>
    3 | using namespace std;
a.cc:13:5: error: 'strncpy' was not declared in this scope
   13 |     strncpy(tmp, S + i, 3);
      |     ^~~~~~~
a.cc:13:5: note: 'strncpy' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
Language: C++

#include <bits/stdc++.h>

using namespace std;
int main(){
  string s;
  scanf("%s", &s);
  int min=999;
  for(int i=0; i<s.length()-2; i++){
    int n = stoi(s[i]+s[i+1]+s[i+2]);
    if(abs(n-754)<min)min=n-754;
  }
  printf("%d\n",min);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: no matching function for call to 'stoi(int)'
    9 |     int n = stoi(s[i]+s[i+1]+s[i+2]);
      |             ~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:54,
                 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/basic_string.h:4164:3: note: candidate: 'int std::__cxx11::stoi(const std::string&, std::size_t*, int)'
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4164:22: note:   no known conversion for argument 1 from 'int' to 'const std::string&' {aka 'const std::__cxx11::basic_string<char>&'}
 4164 |   stoi(const string& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:4432:3: note: candidate: 'int std::__cxx11::stoi(const std::wstring&, std::size_t*, int)'
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |   ^~~~
/usr/include/c++/14/bits/basic_string.h:4432:23: note:   no known conversion for argument 1 from 'int' to 'const std::wstring&' {aka 'const std::__cxx11::basic_string<wchar_t>&'}
 4432 |   stoi(const wstring& __str, size_t* __idx = 0, int __base = 10)
      |        ~~~~~~~~~~~~~~~^~~~~