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

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

int main(){
  string s;
  cin >> s;
  int i=s.size(),a,b,c,mini=-100;
  for(int j=0;j<i-2;j++){
    a=atoi(s[j].c_str());
    b=atoi(s[j+1].c_str());
    c=atoi(s[j+2].c_str());
    int v=abs(a*100+b*10+c);
    if(v<mini){
      mini=v;
    }
  }
  cout << v << endl;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: request for member 'c_str' in 's.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)j))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
    9 |     a=atoi(s[j].c_str());
      |                 ^~~~~
a.cc:10:19: error: request for member 'c_str' in 's.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)(j + 1)))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   10 |     b=atoi(s[j+1].c_str());
      |                   ^~~~~
a.cc:11:19: error: request for member 'c_str' in 's.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)(j + 2)))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   11 |     c=atoi(s[j+2].c_str());
      |                   ^~~~~
a.cc:17:11: error: 'v' was not declared in this scope
   17 |   cout << v << endl;
      |           ^
Language: C++

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

int main(){
  string s;
  cin >> s;
  int i=s.size(),a,b,c,mini=-100;
  for(int j=0;j<i-2;j++){
    a=atoi(s[i].c_str());
    b=atoi(s[i+1].c_str());
    c=atoi(s[i+2].c_str());
    int v=abs(a*100+b*10+c);
    if(v<mini){
      mini=v;
    }
  }
  cout << v << endl;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:9:17: error: request for member 'c_str' in 's.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)i))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
    9 |     a=atoi(s[i].c_str());
      |                 ^~~~~
a.cc:10:19: error: request for member 'c_str' in 's.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)(i + 1)))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   10 |     b=atoi(s[i+1].c_str());
      |                   ^~~~~
a.cc:11:19: error: request for member 'c_str' in 's.std::__cxx11::basic_string<char>::operator[](((std::__cxx11::basic_string<char>::size_type)(i + 2)))', which is of non-class type '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'}
   11 |     c=atoi(s[i+2].c_str());
      |                   ^~~~~
a.cc:17:11: error: 'v' was not declared in this scope
   17 |   cout << v << endl;
      |           ^
Language: C++

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

int main ()
{
    string S;
    cin >> S;
    string subS;
    int ans=753;
    for(int i=0;i<S.size()-2,i++){
        subS=S.substr(i,3);
        ans=min(ans,abs(atoi(subs.c_str())-754)));
    }
}












Compiler output:
a.cc: In function 'int main()':
a.cc:10:33: error: expected ';' before ')' token
   10 |     for(int i=0;i<S.size()-2,i++){
      |                                 ^
      |                                 ;
a.cc:12:30: error: 'subs' was not declared in this scope; did you mean 'subS'?
   12 |         ans=min(ans,abs(atoi(subs.c_str())-754)));
      |                              ^~~~
      |                              subS
Language: C++

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

int main(void){
	string s;
	cin >> s;
	int n = s.length();
	int ans = 1000;

	for(int i=0; i<=n-3; i++){
		int a = s[i]-'0'
		int b = s[i+1]-'0';
		int c = s[i+2]-'0';
		int x = 100*a + 10*b + c;
		ans = min(ans,abs(753-x));
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:17: error: expected ',' or ';' before 'int'
   14 |                 int b = s[i+1]-'0';
      |                 ^~~
a.cc:16:36: error: 'b' was not declared in this scope
   16 |                 int x = 100*a + 10*b + c;
      |                                    ^
Language: C++

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

int main(){
  int x[10];
  int s,ans=1000,z,num,y=1000;
  cin>>s;
  for(int i=0;i<9;i++){
    num=s[i]*100+s[i+1]*10+s[i+2];
    z=abs(753-num);
    if(z<y){
      ans=z;
      y=ans;
    }
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:10: error: invalid types 'int[int]' for array subscript
   11 |     num=s[i]*100+s[i+1]*10+s[i+2];
      |          ^
a.cc:11:19: error: invalid types 'int[int]' for array subscript
   11 |     num=s[i]*100+s[i+1]*10+s[i+2];
      |                   ^
a.cc:11:29: error: invalid types 'int[int]' for array subscript
   11 |     num=s[i]*100+s[i+1]*10+s[i+2];
      |                             ^
Language: C++

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

int main(){
  int x[10];
  int s,ans=1000,z,num,y=1000;
  cin>>s;
  for(int i=0;i<s.size();i++){
    num=x[i]*100+x[i+1]*10+x[i+2];
    z=abs(753-num);
    if(z<y){
      ans=z;
      y=ans;
    }
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: request for member 'size' in 's', which is of non-class type 'int'
   10 |   for(int i=0;i<s.size();i++){
      |                   ^~~~
Language: C++

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

int main(){
  int x[10];
  int s,ans=1000,z,num,y=1000;
  cin>>s;
  for(int i=0;i<s.size();i++){
    num=x[i]*100+x[i+1]*10+x[i+2];
    z=abs(753-num);
    if(z<y){
      ans=z;
      y=ans;
    }
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:19: error: request for member 'size' in 's', which is of non-class type 'int'
    9 |   for(int i=0;i<s.size();i++){
      |                   ^~~~
Language: C++

#include<iostream>
#include<cmath>
int main(){
  int x[10];
  int s,ans=1000,z,num,y=1000;
  cin>>s;
  for(int i=0;i<s.size();i++){
    num=x[i]*100+x[i+1]*10+x[i+2];
    z=abs(753-num);
    if(z<y){
      ans=z;
      y=ans;
    }
  }
  cout<<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    6 |   cin>>s;
      |   ^~~
      |   std::cin
In file included from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:19: error: request for member 'size' in 's', which is of non-class type 'int'
    7 |   for(int i=0;i<s.size();i++){
      |                   ^~~~
a.cc:15:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   15 |   cout<<ans<<endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:15:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   15 |   cout<<ans<<endl;
      |              ^~~~
      |              std::endl
In file included from /usr/include/c++/14/iostream:41:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int main(){
  string x;
  cin>>x;
  
  int digit=S.size();
  int ans = 1000;
  
  for(int i=0; i<digit-2; i++){
    int aho = 753 - stoi(S.substr(i, 3));
    
    ans = min(ans,abs(aho));
  }
  cout<ans<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:13: error: 'S' was not declared in this scope
    7 |   int digit=S.size();
      |             ^
a.cc:15:11: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
   15 |   cout<ans<<endl;
      |        ~~~^~~~~~
Language: C++

// ConsoleApplication1.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//

#include "pch.h"
#include <iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>
using namespace std;
#define rep(i, n) for(long i = 0; i < n; i++)
#define erep(i, n) for(long i = 1; i <= n; i++)
#define show(ans) cout << ans << endl
const long MOD = 1000000007;

int main() {
	string s;
	cin >> s;
	long ans = 1e5;
	//rep(i, s.length-2) {
	//	long num = stoll(s.substr(i, 3));
	//	ans = min(ans, num);
	//}
	long tmp = s.length() -2;
	for (long i = 0; i < tmp; i++) {
		long num = stoll(s.substr(i, 3));
		ans = min(ans, abs(num - 753));
	}

	show(ans);

	return 0;

}
// プログラムの実行: Ctrl + F5 または [デバッグ] > [デバッグなしで開始] メニュー
// プログラムのデバッグ: F5 または [デバッグ] > [デバッグの開始] メニュー

// 作業を開始するためのヒント: 
//    1. ソリューション エクスプローラー ウィンドウを使用してファイルを追加/管理します 
//   2. チーム エクスプローラー ウィンドウを使用してソース管理に接続します
//   3. 出力ウィンドウを使用して、ビルド出力とその他のメッセージを表示します
//   4. エラー一覧ウィンドウを使用してエラーを表示します
//   5. [プロジェクト] > [新しい項目の追加] と移動して新しいコード ファイルを作成するか、[プロジェクト] > [既存の項目の追加] と移動して既存のコード ファイルをプロジェクトに追加します
//   6. 後ほどこのプロジェクトを再び開く場合、[ファイル] > [開く] > [プロジェクト] と移動して .sln ファイルを選択します


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

mespace std;

int main(void){
  string s;
  cin >> s;
  int min = 999;
  for(int i = 0; i <s.length()-2; i++){
    string t = s.substr(i,3);
    min = min < abs(753-stoi(t)) ? min : abs(753-stoi(t));    
  }
  cout << min << endl;
}

Compiler output:
a.cc:1:1: error: 'mespace' does not name a type
    1 | mespace std;
      | ^~~~~~~
a.cc: In function 'int main()':
a.cc:4:3: error: 'string' was not declared in this scope
    4 |   string s;
      |   ^~~~~~
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin >> s;
      |   ^~~
a.cc:5:10: error: 's' was not declared in this scope
    5 |   cin >> s;
      |          ^
a.cc:8:11: error: expected ';' before 't'
    8 |     string t = s.substr(i,3);
      |           ^~
      |           ;
a.cc:9:30: error: 't' was not declared in this scope
    9 |     min = min < abs(753-stoi(t)) ? min : abs(753-stoi(t));
      |                              ^
a.cc:9:25: error: 'stoi' was not declared in this scope
    9 |     min = min < abs(753-stoi(t)) ? min : abs(753-stoi(t));
      |                         ^~~~
a.cc:9:17: error: 'abs' was not declared in this scope
    9 |     min = min < abs(753-stoi(t)) ? min : abs(753-stoi(t));
      |                 ^~~
a.cc:11:3: error: 'cout' was not declared in this scope
   11 |   cout << min << endl;
      |   ^~~~
a.cc:11:18: error: 'endl' was not declared in this scope
   11 |   cout << min << endl;
      |                  ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main () {
  string S;
  cin >> S;
  int min;
  for (int i = 0; i < S.size() - 2; i++) {
    string num = S.substr(i, 3);
    int ans = atoi(S.c_str());
    ans = 753 - ans
    if (abs(ans) < min) min = abs(ans);
  }
  cout << min << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:20: error: expected ';' before 'if'
   10 |     ans = 753 - ans
      |                    ^
      |                    ;
   11 |     if (abs(ans) < min) min = abs(ans);
      |     ~~
Language: C++

#include <algorithm> // min
#include <cmath> // abs
#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:11:12: error: 'c' was not declared in this scope
   11 | int num = (c[i] - '0') * 100 + (c[i+1] - '0') * 10 + c[i+2] - '0';
      |            ^
Language: C++

1 #include <algorithm> // min
2 #include <cmath> // abs
3 #include <iostream>
4 using namespace std;
5 int main(){
6 string S;
7 cin >> S;
8 int N = S.size();
9 int ans = 999;
10 for(int i = 0; i <= N - 3; ++i){
11 int num = (c[i] - '0') * 100 + (c[i+1] - '0') * 10 + c[i+2] - '0';
12 ans = min(ans, abs(num - 753));
13 }
14 cout << ans << endl;
15 }

Compiler output:
a.cc:1:3: error: stray '#' in program
    1 | 1 #include <algorithm> // min
      |   ^
a.cc:2:3: error: stray '#' in program
    2 | 2 #include <cmath> // abs
      |   ^
a.cc:3:3: error: stray '#' in program
    3 | 3 #include <iostream>
      |   ^
a.cc:1:1: error: expected unqualified-id before numeric constant
    1 | 1 #include <algorithm> // min
      | ^
a.cc:5:1: error: expected unqualified-id before numeric constant
    5 | 5 int main(){
      | ^
Language: C++

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

int main(){
    int M=1000;
    string S;
    cin >> S;

    for (int i=0; i<S.size()-2; ++i){
        M=min(M,abs(753-S.at(i)*100-S.at(i+1)*10-S.at(i+2));
    }
    cout << M << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:60: error: expected ')' before ';' token
   12 |         M=min(M,abs(753-S.at(i)*100-S.at(i+1)*10-S.at(i+2));
      |              ~                                             ^
      |                                                            )
Language: C++

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

int main(){
    int M=1000;
    string S;
    cin >> S;

    for (int i=0; i<S.size()-2; ++i){
        M=min(M,abs(753-S.size(i)*100-S.size(i+1)*10-S.size(i+2)));
    }
    cout << M << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:31: error: no matching function for call to 'std::__cxx11::basic_string<char>::size(int&)'
   12 |         M=min(M,abs(753-S.size(i)*100-S.size(i+1)*10-S.size(i+2)));
      |                         ~~~~~~^~~
In file included from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/basic_string.h:1076:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
 1076 |       size() const _GLIBCXX_NOEXCEPT
      |       ^~~~
/usr/include/c++/14/bits/basic_string.h:1076:7: note:   candidate expects 0 arguments, 1 provided
a.cc:12:45: error: no matching function for call to 'std::__cxx11::basic_string<char>::size(int)'
   12 |         M=min(M,abs(753-S.size(i)*100-S.size(i+1)*10-S.size(i+2)));
      |                                       ~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:1076:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
 1076 |       size() const _GLIBCXX_NOEXCEPT
      |       ^~~~
/usr/include/c++/14/bits/basic_string.h:1076:7: note:   candidate expects 0 arguments, 1 provided
a.cc:12:60: error: no matching function for call to 'std::__cxx11::basic_string<char>::size(int)'
   12 |         M=min(M,abs(753-S.size(i)*100-S.size(i+1)*10-S.size(i+2)));
      |                                                      ~~~~~~^~~~~
/usr/include/c++/14/bits/basic_string.h:1076:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]'
 1076 |       size() const _GLIBCXX_NOEXCEPT
      |       ^~~~
/usr/include/c++/14/bits/basic_string.h:1076:7: note:   candidate expects 0 arguments, 1 provided
Language: C++

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

int main(){
    int M=1000;
    string S[10];
    cin >> s;

    for (int i=0; i<S.size()-2; ++i){
        M=min(M,abs(753-S.size(i)*100-S.size(i+1)*10-S.size(i+2)));
    }
    cout << M << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:12: error: 's' was not declared in this scope
    9 |     cin >> s;
      |            ^
a.cc:11:23: error: request for member 'size' in 'S', which is of non-class type 'std::string [10]' {aka 'std::__cxx11::basic_string<char> [10]'}
   11 |     for (int i=0; i<S.size()-2; ++i){
      |                       ^~~~
a.cc:12:27: error: request for member 'size' in 'S', which is of non-class type 'std::string [10]' {aka 'std::__cxx11::basic_string<char> [10]'}
   12 |         M=min(M,abs(753-S.size(i)*100-S.size(i+1)*10-S.size(i+2)));
      |                           ^~~~
a.cc:12:41: error: request for member 'size' in 'S', which is of non-class type 'std::string [10]' {aka 'std::__cxx11::basic_string<char> [10]'}
   12 |         M=min(M,abs(753-S.size(i)*100-S.size(i+1)*10-S.size(i+2)));
      |                                         ^~~~
a.cc:12:56: error: request for member 'size' in 'S', which is of non-class type 'std::string [10]' {aka 'std::__cxx11::basic_string<char> [10]'}
   12 |         M=min(M,abs(753-S.size(i)*100-S.size(i+1)*10-S.size(i+2)));
      |                                                        ^~~~
Language: C++

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

int main(){
    int M=1000;
    string S[10];
    for (int i=0; i<10; ++i) cin >> S[i];

    for (int i=0; i<S.size()-2; ++i){
        M=min(M,abs(753-S.size(i)*100-S.size(i+1)*10-S.size(i+2)));
    }
    cout << M << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:11:23: error: request for member 'size' in 'S', which is of non-class type 'std::string [10]' {aka 'std::__cxx11::basic_string<char> [10]'}
   11 |     for (int i=0; i<S.size()-2; ++i){
      |                       ^~~~
a.cc:12:27: error: request for member 'size' in 'S', which is of non-class type 'std::string [10]' {aka 'std::__cxx11::basic_string<char> [10]'}
   12 |         M=min(M,abs(753-S.size(i)*100-S.size(i+1)*10-S.size(i+2)));
      |                           ^~~~
a.cc:12:41: error: request for member 'size' in 'S', which is of non-class type 'std::string [10]' {aka 'std::__cxx11::basic_string<char> [10]'}
   12 |         M=min(M,abs(753-S.size(i)*100-S.size(i+1)*10-S.size(i+2)));
      |                                         ^~~~
a.cc:12:56: error: request for member 'size' in 'S', which is of non-class type 'std::string [10]' {aka 'std::__cxx11::basic_string<char> [10]'}
   12 |         M=min(M,abs(753-S.size(i)*100-S.size(i+1)*10-S.size(i+2)));
      |                                                        ^~~~
Language: C++

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

int main(){
    int M=1000;
    string S[10];
    for (int i=0; i<10; ++i) cin >> s[i];

    for (int i=0; i<S.size()-2; ++i){
        M=min(M,abs(753-S.size(i)*100-S.size(i+1)*10-S.size(i+2)));
    }
    cout << M << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:37: error: 's' was not declared in this scope
    9 |     for (int i=0; i<10; ++i) cin >> s[i];
      |                                     ^
a.cc:11:23: error: request for member 'size' in 'S', which is of non-class type 'std::string [10]' {aka 'std::__cxx11::basic_string<char> [10]'}
   11 |     for (int i=0; i<S.size()-2; ++i){
      |                       ^~~~
a.cc:12:27: error: request for member 'size' in 'S', which is of non-class type 'std::string [10]' {aka 'std::__cxx11::basic_string<char> [10]'}
   12 |         M=min(M,abs(753-S.size(i)*100-S.size(i+1)*10-S.size(i+2)));
      |                           ^~~~
a.cc:12:41: error: request for member 'size' in 'S', which is of non-class type 'std::string [10]' {aka 'std::__cxx11::basic_string<char> [10]'}
   12 |         M=min(M,abs(753-S.size(i)*100-S.size(i+1)*10-S.size(i+2)));
      |                                         ^~~~
a.cc:12:56: error: request for member 'size' in 'S', which is of non-class type 'std::string [10]' {aka 'std::__cxx11::basic_string<char> [10]'}
   12 |         M=min(M,abs(753-S.size(i)*100-S.size(i+1)*10-S.size(i+2)));
      |                                                        ^~~~
Language: C++

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

int main(){
    int M=1000;
    string S[10];
    for (int i=0; i<10; ++i) cin >> s[i];

    for (int i=0; i<S.size()-2; ++i){
        M=min(M,abs(753-S.size(i)*100-S.size(i+1)*10-S.size(i+2)));
    }
    cout << M << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:37: error: 's' was not declared in this scope
    8 |     for (int i=0; i<10; ++i) cin >> s[i];
      |                                     ^
a.cc:10:23: error: request for member 'size' in 'S', which is of non-class type 'std::string [10]' {aka 'std::__cxx11::basic_string<char> [10]'}
   10 |     for (int i=0; i<S.size()-2; ++i){
      |                       ^~~~
a.cc:11:27: error: request for member 'size' in 'S', which is of non-class type 'std::string [10]' {aka 'std::__cxx11::basic_string<char> [10]'}
   11 |         M=min(M,abs(753-S.size(i)*100-S.size(i+1)*10-S.size(i+2)));
      |                           ^~~~
a.cc:11:41: error: request for member 'size' in 'S', which is of non-class type 'std::string [10]' {aka 'std::__cxx11::basic_string<char> [10]'}
   11 |         M=min(M,abs(753-S.size(i)*100-S.size(i+1)*10-S.size(i+2)));
      |                                         ^~~~
a.cc:11:56: error: request for member 'size' in 'S', which is of non-class type 'std::string [10]' {aka 'std::__cxx11::basic_string<char> [10]'}
   11 |         M=min(M,abs(753-S.size(i)*100-S.size(i+1)*10-S.size(i+2)));
      |                                                        ^~~~
Language: C++

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

int main(){
    int M=1000;
    string s[10];
    for (int i=0; i<10; ++i) cin >> s[i];

    for (int i=0; i<s.size()-2; ++i){
        M=min(M,abs(753-s.size(i)*100-s.size(i+1)*10-s.size(i+2)));
    }
    cout << M << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:23: error: request for member 'size' in 's', which is of non-class type 'std::string [10]' {aka 'std::__cxx11::basic_string<char> [10]'}
   10 |     for (int i=0; i<s.size()-2; ++i){
      |                       ^~~~
a.cc:11:27: error: request for member 'size' in 's', which is of non-class type 'std::string [10]' {aka 'std::__cxx11::basic_string<char> [10]'}
   11 |         M=min(M,abs(753-s.size(i)*100-s.size(i+1)*10-s.size(i+2)));
      |                           ^~~~
a.cc:11:41: error: request for member 'size' in 's', which is of non-class type 'std::string [10]' {aka 'std::__cxx11::basic_string<char> [10]'}
   11 |         M=min(M,abs(753-s.size(i)*100-s.size(i+1)*10-s.size(i+2)));
      |                                         ^~~~
a.cc:11:56: error: request for member 'size' in 's', which is of non-class type 'std::string [10]' {aka 'std::__cxx11::basic_string<char> [10]'}
   11 |         M=min(M,abs(753-s.size(i)*100-s.size(i+1)*10-s.size(i+2)));
      |                                                        ^~~~
Language: C++

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

int main(){
  string S;
  int minIndex,answer;
  int num[S.size()];
  int answer[S.size()-3];
  
  for(int i=0;i<S.size()){
    num[i] = atoi(S[i]);
  }
  for(i=0;i<answer.size();i++){
    answer[i] = num[i]*100 + num[i+1]*10 + num[i+2];
  }
  minIndex=0;
  for(i=1;i<answer.size();i++){
    if(abs(answer[minIndex]-753)>abs(answer[i]-753)){
      minIndex=i;
    }
  }
  answer=answer[minIndex];
  cout<<answer;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'string' was not declared in this scope
    6 |   string S;
      |   ^~~~~~
a.cc:6:3: note: suggested alternatives:
In file included from /usr/include/c++/14/iosfwd:41,
                 from /usr/include/c++/14/ios:40,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stringfwd.h:77:33: note:   'std::string'
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
In file included from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44:
/usr/include/c++/14/string:76:11: note:   'std::pmr::string'
   76 |     using string    = basic_string<char>;
      |           ^~~~~~
a.cc:8:11: error: 'S' was not declared in this scope
    8 |   int num[S.size()];
      |           ^
a.cc:11:25: error: expected ';' before ')' token
   11 |   for(int i=0;i<S.size()){
      |                         ^
      |                         ;
a.cc:12:5: error: 'num' was not declared in this scope; did you mean 'enum'?
   12 |     num[i] = atoi(S[i]);
      |     ^~~
      |     enum
a.cc:14:7: error: 'i' was not declared in this scope
   14 |   for(i=0;i<answer.size();i++){
      |       ^
a.cc:14:20: error: request for member 'size' in 'answer', which is of non-class type 'int'
   14 |   for(i=0;i<answer.size();i++){
      |                    ^~~~
a.cc:15:17: error: 'num' was not declared in this scope; did you mean 'enum'?
   15 |     answer[i] = num[i]*100 + num[i+1]*10 + num[i+2];
      |                 ^~~
      |                 enum
a.cc:18:7: error: 'i' was not declared in this scope
   18 |   for(i=1;i<answer.size();i++){
      |       ^
a.cc:18:20: error: request for member 'size' in 'answer', which is of non-class type 'int'
   18 |   for(i=1;i<answer.size();i++){
      |                    ^~~~
a.cc:19:18: error: invalid types 'int[int]' for array subscript
   19 |     if(abs(answer[minIndex]-753)>abs(answer[i]-753)){
      |                  ^
a.cc:23:16: error: invalid types 'int[int]' for array subscript
   23 |   answer=answer[minIndex];
      |                ^
a.cc:24:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   24 |   cout<<answer;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
Language: C++

S = input()
mindiff = None
for i in range(len(S) - 2):
    n = abs(int(S[i:i + 3]) - 753)
    if mindiff is None:
        mindiff = n
    else:
        mindiff = min(mindiff, n)

print(mindiff)

Compiler output:
a.cc:1:1: error: 'S' does not name a type
    1 | S = input()
      | ^
Language: Java

import java.util.Scanner;
 
public class Main {
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
        String str = sc.next();
		int minDiff = Integer.MAX_VALUE;
        for (int i=0; i<str.length()-2; i++) {
        	int threeDigitNum = Integer.parseInt(str.substring(i, i+3));
            int diff = Math.abs(753 - threeDigitNum);
            minDiff = Math.min(diff, minDiff);
        }
        return minDiff;
    }
}

Compiler output:
Main.java:13: error: incompatible types: unexpected return value
        return minDiff;
               ^
1 error
Language: Java

import java.util.Scanner;
 
public class Main {
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
        String str = sc.next();
		int minDiff = Integer.MAX_VALUE;
        for (int i=0; i<n-2; i++) {
        	int threeDigitNum = Integer.parseInt(str.substring(i, i+3));
            int diff = Math.abs(753 - threeDigitNum);
            minDiff = Math.min(diff, minDiff);
        }
        System.out.println(minDiff);
    }
}

Compiler output:
Main.java:8: error: cannot find symbol
        for (int i=0; i<n-2; i++) {
                        ^
  symbol:   variable n
  location: class Main
1 error
Language: Java

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
        String str = sc.next();
		int minDiff = Integer.MAX_VALUE;
        for (int i=0; i<n-2; i++) {
        	int threeDigitNum = Integer.parseInt(str.substring(i, i+3));
            int diff = Math.abs(753 - threeDigitNum);
            minDiff = Math.min(diff, minDiff);
        }
        return minDiff;
    }
}

Compiler output:
Main.java:8: error: cannot find symbol
        for (int i=0; i<n-2; i++) {
                        ^
  symbol:   variable n
  location: class Main
Main.java:13: error: incompatible types: unexpected return value
        return minDiff;
               ^
2 errors
Language: C++

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

Compiler output:
a.cc: In function 'int main()':
a.cc:9:2: error: 'intN' was not declared in this scope; did you mean 'int'?
    9 |  intN=
      |  ^~~~
      |  int
a.cc:10:2: error: expected primary-expression before 'int'
   10 |  int ans
      |  ^~~
a.cc: At global scope:
a.cc:15:3: error: 'cout' does not name a type
   15 |   cout <<
      |   ^~~~
a.cc:16:1: error: expected declaration before '}' token
   16 | }
      | ^
a.cc:17:1: error: 'S' does not name a type
   17 | S.size();
      | ^
a.cc:18:1: error: expected unqualified-id before '=' token
   18 | = 999;
      | ^
a.cc:19:1: error: 'i' does not name a type
   19 | i=0;i<=N-3;++i){ num=(c[i]-'0')*100+(c[i+1]-'0')*10+c[i+2]-'0'; = min(ans, abs(num - 753));
      | ^
a.cc:19:5: error: 'i' does not name a type
   19 | i=0;i<=N-3;++i){ num=(c[i]-'0')*100+(c[i+1]-'0')*10+c[i+2]-'0'; = min(ans, abs(num - 753));
      |     ^
a.cc:19:12: error: expected unqualified-id before '++' token
   19 | i=0;i<=N-3;++i){ num=(c[i]-'0')*100+(c[i+1]-'0')*10+c[i+2]-'0'; = min(ans, abs(num - 753));
      |            ^~
Language: C++

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

int main(){
  string s;
  cin>>s;
  int minimum=999;
  for(int i=0;i<s.length()-2;i++){
    int hyaku=atoi(s[i]);
    int juu=atoi(s[i+1]);
    int iti=atoi(s[i+2]);
    int picked=100*hyaku+10*juu+iti;
    minimum=min(abs(picked-753),minimum);
  }
  cout<<minimum<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
   10 |     int hyaku=atoi(s[i]);
      |               ~~~~^~~~~~
      |                   |
      |                   __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
a.cc:11:17: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
   11 |     int juu=atoi(s[i+1]);
      |             ~~~~^~~~~~~~
      |                 |
      |                 __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
a.cc:12:17: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
   12 |     int iti=atoi(s[i+2]);
      |             ~~~~^~~~~~~~
      |                 |
      |                 __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}
/usr/include/stdlib.h:105:30: note:   initializing argument 1 of 'int atoi(const char*)'
  105 | extern int atoi (const char *__nptr)
      |                  ~~~~~~~~~~~~^~~~~~
Language: Java

import java.util.Scanner;

public static Main{
  public static void main(String[] args){
    Scanner stdin = new Scanner(System.in);
    String s = stdin.next();
    int min = Integer.MAX_VALUE;
    for(int i = 0; i < s.length() - 2; i++){
      int num = Integer.parseInt(s.substring(i, i + 3));
      int diff = Math.abs(num - 753);
      
      if(diff < min){
        min = diff;
      }
    }
    System.out.println(min);
  }
}

Compiler output:
Main.java:3: error: class, interface, enum, or record expected
public static Main{
              ^
Main.java:4: error: unnamed classes are a preview feature and are disabled by default.
  public static void main(String[] args){
                ^
  (use --enable-preview to enable unnamed classes)
Main.java:18: error: class, interface, enum, or record expected
}
^
3 errors
Language: C++

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

int main(){
    int result=999;
    int N;
    string S;
    cin >> S;
    for(int i=0;i<length(S)-2;i++){
        N=10*(10*S[i]+S[i+1])+S[i+2];
        if(753<N){
            if(result>753-N){
                result=753-N;
            }
        }else{
            if(result>N-753){
                result=N-753;
            }
        }
    }
    cout << result << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: 'length' was not declared in this scope
   10 |     for(int i=0;i<length(S)-2;i++){
      |                   ^~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <map>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef pair<double, ll> pdlg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
typedef tuple<double, double, double> tddd;
static const int giga = pow(10,9);

int main(void){
  vector<int> str;
  do {
    int temp;
    cin >> temp;
    str.pop_back(temp);
  } while (is.eof());
  
  int len = str.size();
  int ans = giga;
  for(int i = 0; i++; i < len-2){
    int temp;
    temp = abs(((int)str.at(i) )*100 + ((int)str.at(i+1) )*10 + ((int)str.at(i+2) ) - 753);
    if(temp < ans){
      ans = temp;
    }
  }

  cout << ans << endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:17: error: no matching function for call to 'std::vector<int>::pop_back(int&)'
   22 |     str.pop_back(temp);
      |     ~~~~~~~~~~~~^~~~~~
In file included from /usr/include/c++/14/vector:66,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_vector.h:1324:7: note: candidate: 'void std::vector<_Tp, _Alloc>::pop_back() [with _Tp = int; _Alloc = std::allocator<int>]'
 1324 |       pop_back() _GLIBCXX_NOEXCEPT
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:1324:7: note:   candidate expects 0 arguments, 1 provided
a.cc:23:12: error: 'is' was not declared in this scope
   23 |   } while (is.eof());
      |            ^~
Language: C++

#include<cmath>
#include<map>
#define INF INT_MAX
using namespace std;

string S;
int N;
int ans = 999;
int main(){
	cin >> S;
	N = S.size();
	for (int i = 0; i <= N - 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 << endl;

	return 0;
}

Compiler output:
a.cc:6:1: error: 'string' does not name a type
    6 | string S;
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:10:9: error: 'cin' was not declared in this scope
   10 |         cin >> S;
      |         ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include<map>
  +++ |+#include <iostream>
    3 | #define INF INT_MAX
a.cc:10:16: error: 'S' was not declared in this scope
   10 |         cin >> S;
      |                ^
a.cc:18:9: error: 'cout' was not declared in this scope
   18 |         cout << ans << endl;
      |         ^~~~
a.cc:18:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:18:24: error: 'endl' was not declared in this scope
   18 |         cout << ans << endl;
      |                        ^~~~
a.cc:3:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    2 | #include<map>
  +++ |+#include <ostream>
    3 | #define INF INT_MAX
Language: C++

#include <bits/stdc++.h>

using namespace std;

int main(){
  string a;
  cin>>a;
  sort(a.begin(),a.end(),greater<int>());
  cout<<abs(((a[0]-'0')*100+(a[1]-'0')*10++(a[2]-'0'))-753);
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:40: error: lvalue required as increment operand
    9 |   cout<<abs(((a[0]-'0')*100+(a[1]-'0')*10++(a[2]-'0'))-753);
      |                                        ^~
Language: C++

#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#pragma warning(disable:4996)
using namespace std;

string s;
int len;

int bf[1010];
int index = 1;

int _minus(int x, int y)
{
	if (x > y)
		return x - y;
	else if (y > x)
		return y - x;
	else if (x == y)
		return x - y;
}

int main()
{
	cin >> s;
	len = s.size();

	for (int i = 0; i < len - 2; i++)
	{
		int g = 100;
		for (int j = i; j <= i + 2; j++)
		{
			bf[index] += (s[j]-'0') * g;
			g /= 10;
		}
		index++;
	}

	int ch = _minus(753, bf[1]);
	for (int i = 1; i <= index; i++)
	{
		ch = min(ch, _minus(753, bf[i]));
	}
	printf("%d", ch);
}

Compiler output:
a.cc:13:5: error: 'int index' redeclared as different kind of entity
   13 | int index = 1;
      |     ^~~~~
In file included from /usr/include/string.h:462,
                 from /usr/include/c++/14/cstring:43,
                 from a.cc:5:
/usr/include/strings.h:50:20: note: previous declaration 'const char* index(const char*, int)'
   50 | extern const char *index (const char *__s, int __c)
      |                    ^~~~~
a.cc: In function 'int main()':
a.cc:35:27: error: invalid types 'int [1010][<unresolved overloaded function type>]' for array subscript
   35 |                         bf[index] += (s[j]-'0') * g;
      |                           ^
a.cc:38:22: error: no post-increment operator for type
   38 |                 index++;
      |                      ^~
a.cc:42:27: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<='
   42 |         for (int i = 1; i <= index; i++)
      |                         ~~^~~~~~~~
a.cc: In function 'int _minus(int, int)':
a.cc:23:1: warning: control reaches end of non-void function [-Wreturn-type]
   23 | }
      | ^
Language: Java

public class Main {

	public static void main(String[] args) {
	
		Scanner scan = new Scanner(System.in);
		String input = scan.nextLine();
		int min = Math.abs(Integer.parseInt(input.substring(0,3))-753);
		for(int i = 0; i < input.length() - 2; i++) {
			String temp = input.substring(i, i+3);
			int x = Integer.parseInt(temp);
			int diff = Math.abs(x - 753);
			if(diff<min) {
				min = diff;
			}
		}
		System.out.println(min);
		scan.close();
	}
	
}


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

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

int solve(char*s)
{
  int c=s(s[0])*100+(s[1])*10+(s[2])-753;
  return c<0?-c:c;
}
int main(void)
{
  int i,res=999;
  char s[12];
  scanf("%s",s);
  for(i=0;s[i+2];i++)
    res=min(res,solve(s+i));
  printf("%d\n",res);
  return 0;
}

Compiler output:
a.cc: In function 'int solve(char*)':
a.cc:7:10: error: 's' cannot be used as a function
    7 |   int c=s(s[0])*100+(s[1])*10+(s[2])-753;
      |         ~^~~~~~
Language: C

#include<stdio.h>
#include<math.h>


int Min(int a,int b){
    if(a<b) return a;
    return b;
}

int main(void){
    long N,X,min;
    scanf("%d",&N);
    
    for(int i = 0; i < 10; i++)
    {
        X=N%(1e+(i+3))/(1e+i);
        min=Min(min,(int)fabs(X-753));
    }

    printf("%d",min);
    
    
    
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:16:14: error: exponent has no digits
   16 |         X=N%(1e+(i+3))/(1e+i);
      |              ^~~
main.c:16:25: error: exponent has no digits
   16 |         X=N%(1e+(i+3))/(1e+i);
      |                         ^~~~
Language: C

#include<stdio.h>

int Min(int a,int b){
    if(a<b) return a;
    return b;
}

int main(void){
    int N,X,min;
    scanf("%d",&N);
    
    for(int i = 0; i < 6; i++)
    {
        X=N%(1e+(i+3))/(1e+i);
        min=Min(min,(int)fabs(X-753));
    }

    printf("%d",min);
    
    
    
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:14: error: exponent has no digits
   14 |         X=N%(1e+(i+3))/(1e+i);
      |              ^~~
main.c:14:25: error: exponent has no digits
   14 |         X=N%(1e+(i+3))/(1e+i);
      |                         ^~~~
main.c:15:26: error: implicit declaration of function 'fabs' [-Wimplicit-function-declaration]
   15 |         min=Min(min,(int)fabs(X-753));
      |                          ^~~~
main.c:2:1: note: include '<math.h>' or provide a declaration of 'fabs'
    1 | #include<stdio.h>
  +++ |+#include <math.h>
    2 | 
main.c:15:26: warning: incompatible implicit declaration of built-in function 'fabs' [-Wbuiltin-declaration-mismatch]
   15 |         min=Min(min,(int)fabs(X-753));
      |                          ^~~~
main.c:15:26: note: include '<math.h>' or provide a declaration of 'fabs'
Language: C

#include<stdio.h>

int Min(int a,int b){
    if(a<b) return a;
    return b;
}

int main(void){
    int N,min;
    scanf("%d",&N);
    
    for(int i = 0; i < 6; i++)
    {
        X=N%(1e+(i+3))/(1e+i);
        min=Min(min,(int)fabs(X-753));
    }

    printf("%d",min);
    
    
    
    return 0;
}

Compiler output:
main.c: In function 'main':
main.c:14:9: error: 'X' undeclared (first use in this function)
   14 |         X=N%(1e+(i+3))/(1e+i);
      |         ^
main.c:14:9: note: each undeclared identifier is reported only once for each function it appears in
main.c:14:14: error: exponent has no digits
   14 |         X=N%(1e+(i+3))/(1e+i);
      |              ^~~
main.c:14:25: error: exponent has no digits
   14 |         X=N%(1e+(i+3))/(1e+i);
      |                         ^~~~
main.c:15:26: error: implicit declaration of function 'fabs' [-Wimplicit-function-declaration]
   15 |         min=Min(min,(int)fabs(X-753));
      |                          ^~~~
main.c:2:1: note: include '<math.h>' or provide a declaration of 'fabs'
    1 | #include<stdio.h>
  +++ |+#include <math.h>
    2 | 
main.c:15:26: warning: incompatible implicit declaration of built-in function 'fabs' [-Wbuiltin-declaration-mismatch]
   15 |         min=Min(min,(int)fabs(X-753));
      |                          ^~~~
main.c:15:26: note: include '<math.h>' or provide a declaration of 'fabs'
Language: C++

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

int main(){
  string S;
  cin >> S;
  
  int n =S.size();
  int x = 999;
  for(int i=0;i<n-2;i++){
    int w = (S[i] - "0") * 100 + (S[i+1] - "0") * 10 + (S[i+2] - "0");
    x = min(x, abs(w-753));
  }
  
  cout << x;
  
  return 0;
}






Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} and 'const char [2]' to binary 'operator-'
   13 |     int w = (S[i] - "0") * 100 + (S[i+1] - "0") * 10 + (S[i+2] - "0");
a.cc:13:42: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} and 'const char [2]' to binary 'operator-'
   13 |     int w = (S[i] - "0") * 100 + (S[i+1] - "0") * 10 + (S[i+2] - "0");
a.cc:13:64: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} and 'const char [2]' to binary 'operator-'
   13 |     int w = (S[i] - "0") * 100 + (S[i+1] - "0") * 10 + (S[i+2] - "0");
Language: C++

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

int main(){
  string S;
  cin >> S;
  
  int n =S.size();
  int x = 999;
  for(int i=0;i<n-3;i++){
    int w = (S[i] - "0") * 100 + (S[i+1] - "0") * 10 + (S[i+2] - "0");
    x = min(x, abs(w-753));
  }
  
  cout << x;
  
  return 0;
}





Compiler output:
a.cc: In function 'int main()':
a.cc:13:19: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} and 'const char [2]' to binary 'operator-'
   13 |     int w = (S[i] - "0") * 100 + (S[i+1] - "0") * 10 + (S[i+2] - "0");
a.cc:13:42: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} and 'const char [2]' to binary 'operator-'
   13 |     int w = (S[i] - "0") * 100 + (S[i+1] - "0") * 10 + (S[i+2] - "0");
a.cc:13:64: error: invalid operands of types '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} and 'const char [2]' to binary 'operator-'
   13 |     int w = (S[i] - "0") * 100 + (S[i+1] - "0") * 10 + (S[i+2] - "0");
Language: C++

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

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


Compiler output:
a.cc:6:5: error: cannot declare '::main' to be a global variable
    6 | int main{
      |     ^~~~
a.cc:7:10: error: expected primary-expression before 'S'
    7 |   string S;
      |          ^
a.cc:7:10: error: expected '}' before 'S'
a.cc:6:9: note: to match this '{'
    6 | int main{
      |         ^
a.cc:8:3: error: 'cin' does not name a type
    8 |   cin >> S;
      |   ^~~
a.cc:10:10: error: 'S' was not declared in this scope
   10 |   int n =S.size();
      |          ^
a.cc:12:3: error: expected unqualified-id before 'for'
   12 |   for(int i=0;i<N-3;i++){
      |   ^~~
a.cc:12:15: error: 'i' does not name a type
   12 |   for(int i=0;i<N-3;i++){
      |               ^
a.cc:12:21: error: 'i' does not name a type
   12 |   for(int i=0;i<N-3;i++){
      |                     ^
a.cc:17:3: error: 'cout' does not name a type
   17 |   cout << x;
      |   ^~~~
a.cc:19:3: error: expected unqualified-id before 'return'
   19 |   return 0;
      |   ^~~~~~
a.cc:20:1: error: expected declaration before '}' token
   20 | }
      | ^