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

#inclued<bits/stdc+.h>
using namespace std;
int main(){
  string S;
  cin>>S;
  vector<int>list(S.size());
  for(int i=0;i<S.size;i++){
    list.at(i)=S.at(i)-'0';
  }
  int min=700;
  for(int i=0;i<S.size()-2){
    int k;
    int t;
    k=S.at(i)*100+S.at(i+1)*10+S.at(i+2);
    t=max(k,753)-min(k,753);
    if(t<min){
      min=t;
    }
    else{
    }
  }
  cout<<min<<endl;
}

Compiler output:
a.cc:1:2: error: invalid preprocessing directive #inclued; did you mean #include?
    1 | #inclued<bits/stdc+.h>
      |  ^~~~~~~
      |  include
a.cc: In function 'int main()':
a.cc:4:3: error: 'string' was not declared in this scope
    4 |   string S;
      |   ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | #inclued<bits/stdc+.h>
a.cc:5:3: error: 'cin' was not declared in this scope
    5 |   cin>>S;
      |   ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | #inclued<bits/stdc+.h>
a.cc:5:8: error: 'S' was not declared in this scope
    5 |   cin>>S;
      |        ^
a.cc:6:3: error: 'vector' was not declared in this scope
    6 |   vector<int>list(S.size());
      |   ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | #inclued<bits/stdc+.h>
a.cc:6:10: error: expected primary-expression before 'int'
    6 |   vector<int>list(S.size());
      |          ^~~
a.cc:8:5: error: 'list' was not declared in this scope
    8 |     list.at(i)=S.at(i)-'0';
      |     ^~~~
a.cc:1:1: note: 'std::list' is defined in header '<list>'; this is probably fixable by adding '#include <list>'
  +++ |+#include <list>
    1 | #inclued<bits/stdc+.h>
a.cc:11:27: error: expected ';' before ')' token
   11 |   for(int i=0;i<S.size()-2){
      |                           ^
      |                           ;
a.cc:15:7: error: 'max' was not declared in this scope
   15 |     t=max(k,753)-min(k,753);
      |       ^~~
a.cc:15:21: error: 'min' cannot be used as a function
   15 |     t=max(k,753)-min(k,753);
      |                  ~~~^~~~~~~
a.cc:22:3: error: 'cout' was not declared in this scope
   22 |   cout<<min<<endl;
      |   ^~~~
a.cc:22:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:22:14: error: 'endl' was not declared in this scope
   22 |   cout<<min<<endl;
      |              ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | #inclued<bits/stdc+.h>
Language: C++

#include <bits/stdc++.h>
#include <cstdio>
#include <cstdlib>
using namespace std;
typedef long long ll;

#define pb push_back
#define FOR(i, s, e) for (int (i) = (s); (i) < (e); (i)++)

int main() {
    string S; int N = S.size();
    vector<int> s;
    FOR(i, 0, N) s.pb(stoi(S.substr(i, 1)));

    ans = 753;
    FOR(i, 0, N - 2) {
        int X = s[i] * 100 + s[i+1] * 10 + s[i+2];
        ans = min(ans,abs(X - 753));
    }

    cout << ans << endl;

}


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

#include <bits/stdc++.h>
#include <cstdio>
#include <cstdlib>
using namespace std;
typedef long long ll;

#define pb push_back
#define FOR(i, s, e) for (int (i) = (s); (i) < (e); (i)++)

int main() {
    string S; int N = S.size();
    vector<int> s;
    FOR(i, 0, N) s.pb(stoi(S.substr(i, 1)));

    int ans = 0;
    FOR(i, 0, N) {
        FOR(j, 0, N) {
            FOR(k, 0, N) {
                int X = s[i] * 100 + s[j] * 10 + s[k];
                if(abs(X - 753) < abs(ans - 753)) ans = X;
            }
        }
    }

    int y = abs(X - 753);
    printf("%d\n", y);

}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:17: error: 'X' was not declared in this scope
   25 |     int y = abs(X - 753);
      |                 ^
Language: C++

#include <bits/stdc++.h>
#include <cstdio>
#include <cstdlib>
using namespace std;
typedef long long ll;

#define pb push_back
#define FOR(i, s, e) for (int (i) = (s); (i) < (e); (i)++)

int main() {
    string S; int N = S.size();
    vector<int> s;
    FOR(i, 0, N) s.pb(stoi(S.substr(i, 1)));

    int ans = 0;
    FOR(i, 0, N) {
        FOR(j, 0, N) {
            FOR(k, 0, N) {
                int X = s[i] * 100 + s[j] * 10 + s[k];
                if(abs(X - 753) < abs(ans - 753)) ans = X;
            }
        }
    }

    printf("%d\n", abs(X - 753));

}


Compiler output:
a.cc: In function 'int main()':
a.cc:25:24: error: 'X' was not declared in this scope
   25 |     printf("%d\n", abs(X - 753));
      |                        ^
Language: C++

#include <bits/stdc++.h>
#include <cstdio>
#include <cstdlib>
using namespace std;
typedef long long ll;

#define pb push_back
#define FOR(i, s, e) for (int (i) = (s); (i) < (e); (i)++)

int main() {
    string S; int N = S.size();
    vector<int> s;
    FOR(i, 0, N) s.pb(atoi(S.substr(i, 1)));

    int ans = 0;
    FOR(i, 0, N) {
        FOR(j, 0, N) {
            FOR(k, 0, N) {
                int X = s[i] * 100 + s[j] * 10 + s[k];
                if(abs(X - 753) < abs(ans - 753)) ans = X;
            }
        }
    }

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

}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:36: error: cannot convert 'std::__cxx11::basic_string<char>' to 'const char*'
   13 |     FOR(i, 0, N) s.pb(atoi(S.substr(i, 1)));
      |                            ~~~~~~~~^~~~~~
      |                                    |
      |                                    std::__cxx11::basic_string<char>
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 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)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main(){
    string s;
    int n = s.size();
    int nums,min = 1000;
    string buf;
    for(int i =0;i<n-2;i++){
        buf.push_back(substr(i,3));
        int nums = stoi(buf);
        int subs = abs(nums-753);
        if(subs<min){
            min = subs;
        }
    }
    cout << min << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:23: error: 'substr' was not declared in this scope
   11 |         buf.push_back(substr(i,3));
      |                       ^~~~~~
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main()
{
  string s;
  int a, b=999;
  cin >> s;
  for(int i=0; i<s.size()-3; i++){
    a = atoi(s.c_str(i, 3));
    b = min(abs(753-a), b);
  }
  cout << b << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:21: error: no matching function for call to 'std::__cxx11::basic_string<char>::c_str(int&, int)'
   10 |     a = atoi(s.c_str(i, 3));
      |              ~~~~~~~^~~~~~
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:2640:7: note: candidate: 'const _CharT* std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::c_str() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
 2640 |       c_str() const _GLIBCXX_NOEXCEPT
      |       ^~~~~
/usr/include/c++/14/bits/basic_string.h:2640:7: note:   candidate expects 0 arguments, 2 provided
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main()
{
  string s;
  int a, b=999;
  cin >> s;
  for(int i=0; i<s.size()-3; i++){
    a = atoi(s.substr(i, 3));
    b = min(abs(753-a), b);
  }
  cout << b << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:22: error: cannot convert 'std::__cxx11::basic_string<char>' to 'const char*'
   10 |     a = atoi(s.substr(i, 3));
      |              ~~~~~~~~^~~~~~
      |                      |
      |                      std::__cxx11::basic_string<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)
      |                  ~~~~~~~~~~~~^~~~~~
Language: C++

#include<iostream>
#include<string>
using namespace std;
int main()
{
  string s;
  int a, b=999;
  cin >> s;
  for(int i=0; i<s.size()-3; i++){
    a = (int)s.substr(i, 3);
    b = min(abs(753-a), b);
  }
  cout << b << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: invalid cast from type 'std::__cxx11::basic_string<char>' to type 'int'
   10 |     a = (int)s.substr(i, 3);
      |         ^~~~~~~~~~~~~~~~~~~
Language: C++

#include<iosrteam>
using namespace std;
int main()
{
  string s;
  int a, b=999;
  cin >> s;
  for(int i=0; i<s.size()-3; i++){
    a = (int)s.substr(i, 3);
    b = min(abs(753-a), b);
  }
  cout << b << endl;
}


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

#include<iostream>
using namespace std;
int main()
{
  string s;
  cin >> s;
  int N = s.size();
  int a[N];
  int ans;
  for(int i=0; i<N; i++){
    a[i] = s[i]*100+s[i+1]*10+s[i+2];
    ans = min(abs(a[i]-753));
  }
  cout << ans << endl;
}
      

Compiler output:
a.cc: In function 'int main()':
a.cc:12:14: error: no matching function for call to 'min(int)'
   12 |     ans = min(abs(a[i]-753));
      |           ~~~^~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 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/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 1 provided
Language: C++

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

int getNum(char c){return c - '0';}


int main(){
	string s;
	cin >> s;
	
	int length = s.size() - 2;
	int minDif = 1000;
	for(int i=0; i<lenth; i++){
		int num = getNum(s[i]) * 100 + getNum(s[i+1]) * 10 + getNum(s[i+2]);
		int dif = abs(753 - num);
		minDif = min(minDif, dif);
	}
	cout << minDif << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:13:24: error: 'lenth' was not declared in this scope; did you mean 'length'?
   13 |         for(int i=0; i<lenth; i++){
      |                        ^~~~~
      |                        length
Language: C++

#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    string S;
    cin >> S;
    
    int i=0;
    int a=0;
    int MIN=1000;
    int s=0;
    s=stoi(S);
    
    while (i<(S.size()/3)) {
        
        
        
        a = stoi(S[i]+S[i+1]+S[i+2]);
        
        MIN=min(a,MIN);
        
        i=i+1;
    }
    
    cout << MIN<<endl;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: no matching function for call to 'stoi(int)'
   18 |         a = stoi(S[i]+S[i+1]+S[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: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)
      |        ~~~~~~~~~~~~~~~^~~~~
Language: C++

#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    string S;
    cin >> S;
    
    int i=0;
    int a=0;
    int MIN=1000;
    int s=0;
    s=stoi(S);
    
    while (i<(size(S)/3)) {
        
        
        
        a = stoi(S[i]+S[i+1]+S[i+2]);
        
        MIN=min(a,MIN);
        
        i=i+1;
    }
    
    cout << MIN<<endl;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: no matching function for call to 'stoi(int)'
   18 |         a = stoi(S[i]+S[i+1]+S[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: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)
      |        ~~~~~~~~~~~~~~~^~~~~
Language: C++

#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    string S;
    cin >> S;
    
    int i=0;
    int a=0;
    int MIN=1000;
    int s=0;
    s=stoi(S);
    
    while (i<(size(S)/3)) {
        
        
        
        a = stoi(S[i]+S[i+1]+S[i+2])
        
        MIN=min(a,MIN);
        
        i=i+1;
    }
    
    cout << MIN<<endl;
    
}


Compiler output:
a.cc: In function 'int main()':
a.cc:18:17: error: no matching function for call to 'stoi(int)'
   18 |         a = stoi(S[i]+S[i+1]+S[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: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)
      |        ~~~~~~~~~~~~~~~^~~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
int c2i (char c){
    return c - '0';
}
int main () {
    string s;
    cin >> s;
    int min = 1000;
    for(int i = 0; i < (int)s.size-2; i++)
    {
        int tmp = c2i(s[i]) * 100 + c2i(s[i+1]) * 10 + c2i(s[i + 2]) * 1;
        if(min > abs(tmp - 754)){
            min = abs(tmp - 754);
        }
        cout << min << endl;
    }
    
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:31: error: invalid use of member function '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]' (did you forget the '()' ?)
   10 |     for(int i = 0; i < (int)s.size-2; i++)
      |                             ~~^~~~
      |                                   ()
Language: C++

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

int main(){
    int i, n, a = 9999;
    string s;
    cin >> s;
    for(i=0; i<s.size()-2, i++){
        n = (int)100*(s[i]-'0') + 10*(s[i]-'0') + (s[i]-'0');
        a = min(a, abs(753-n));
    }
    cout << a;
    return 0;
}

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

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

int main(){
    string s;
    cin >> s;
    int x ,a[10], ans=0; x=s.size();

    for (int i=0; i < x; i++){
        a[i]=atoi(s[i].c_str())
    }

    for (int i=2; i < x ; i++ ){
        int u;
        u=a[i-2]*100 + a[i-1]*10 + a[i];
        if ( abs(u-753) <= abs(ans-753) ) ans=u;
    }

    cout << abs(ans-753) << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:24: 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'}
   11 |         a[i]=atoi(s[i].c_str())
      |                        ^~~~~
Language: C++

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

int main(){
    string s;
    cin >> s;
    int x ,a[10], ans=0; x=s.size();

    for (int i=0; i < x; i++){
        a[i]=atoi(s[i])
    }

    for (int i=2; i < x ; i++ ){
        int u;
        u=a[i-2]*100 + a[i-1]*10 + a[i];
        if ( abs(u-753) <= abs(ans-753) ) ans=u;
    }

    cout << abs(ans-753) << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:18: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
   11 |         a[i]=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/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 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:24: error: expected ';' before '}' token
   11 |         a[i]=atoi(s[i])
      |                        ^
      |                        ;
   12 |     }
      |     ~
Language: C++

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

int main(){
    string s;
    cin >> s;
    int x a[10], ans=0; x=s.size();

    for (int i=0; i < x; i++){
        a[i]=atoi(s[i])
    }

    for (int i=2; i < x ; i++ ){
        int u;
        u=a[i-2]*100 + a[i-1]*10 + a[i];
        if ( abs(u-753) <= abs(ans-753) ) ans=u;
    }

    cout << abs(ans-753) << endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:11: error: expected initializer before 'a'
    8 |     int x a[10], ans=0; x=s.size();
      |           ^
a.cc:8:25: error: 'x' was not declared in this scope
    8 |     int x a[10], ans=0; x=s.size();
      |                         ^
a.cc:11:9: error: 'a' was not declared in this scope
   11 |         a[i]=atoi(s[i])
      |         ^
a.cc:11:18: error: invalid conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'const char*' [-fpermissive]
   11 |         a[i]=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/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 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:16:11: error: 'a' was not declared in this scope
   16 |         u=a[i-2]*100 + a[i-1]*10 + a[i];
      |           ^
a.cc:17:32: error: 'ans' was not declared in this scope; did you mean 'abs'?
   17 |         if ( abs(u-753) <= abs(ans-753) ) ans=u;
      |                                ^~~
      |                                abs
a.cc:20:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   20 |     cout << abs(ans-753) << endl;
      |                 ^~~
      |                 abs
Language: C++

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

int main(){
    string s;
    cin >> s;
    int x, ans=0; x=s.size();

    for (int i=2; i < x ; i++ ){
        string t;
        int u;
        t=s[i-2]+s[i-1]+s[i];
        u=atoi(t.c_str());
        if ( abs(u-753) <= abs(ans-753) ) ans=u;
    }

    cout << ans << emdl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:18:20: error: 'emdl' was not declared in this scope
   18 |     cout << ans << emdl;
      |                    ^~~~
Language: C

#include <stdio.h>

int main(int argc, char *argv[]) {
  int s, c, min = 999999999, r, d;
  scanf("%d", %s);
  while (s > 100) {
    c = s % 1000;
    d = 753 - c;
    if (d < 0) d = -d;
    if (d < min) {
      min = d;
      r = c;
    }
    s /= 10;
  }
  printf("%d\n", r);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:5:15: error: expected expression before '%' token
    5 |   scanf("%d", %s);
      |               ^
Language: C

    #include<stdio.h>
    #include<string.h>
    int main(void){
    int A,B,C,D,E,N,M,x,y,i,j,cou=0,cou2=9999999,v[1000000],w[1000000],min_i,en=0;
        char S[100],W[100],s[10],X,Y;
    scanf("%s",&S);
    A=strlen(S);
    for(i=0;i<A-2;i++){
        cou=S[i]*100+S[i+1]*10+S[i+2];
        if((754-cou)<(754-cou2){
            cou2=754-cou;
        }
    }
    printf("%d",cou2);
    return 0;
    }

Compiler output:
main.c: In function 'main':
main.c:10:32: error: expected ')' before '{' token
   10 |         if((754-cou)<(754-cou2){
      |           ~                    ^
      |                                )
main.c:13:5: error: expected expression before '}' token
   13 |     }
      |     ^
Language: C++

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

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


Compiler output:
a.cc: In function 'int main()':
a.cc:10:19: error: 'a' was not declared in this scope
   10 |   cout << abs(753-a) << endl;
      |                   ^
Language: C

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

int func(int x, int y, int z) {
  int temp, cmp;
  temp = (x % y) / z;
  if(temp < 100) {
    return 999;
  } if else(temp > 753) {
    cmp = temp -753;
  } else {
    cmp = 753 - temp;
  }
  return cmp;
}

int main() {
  int num, ans = 999, tmp, i;
  scanf("%d", &num);
  for(i = 0; i < 8; i++) {
    tmp = func(num, pow(10, i+3), pow(10, i));
    if(ans > tmp) {
      ans = tmp;
    }
  }
  printf("%d\n", ans);
  return 0;
}


Compiler output:
main.c: In function 'func':
main.c:9:8: error: expected '(' before 'else'
    9 |   } if else(temp > 753) {
      |        ^~~~
      |        (
Language: C

#include <stdio.h>

int main(){
    char s[10];scanf("%s",s);
    int i=0;int min=1e3;int abs;
    
    while(s[i+2]!='\0'){
        x=(int)((s[i]-'0')*100+(s[i+1]-'0')*10+(s[i+2]-'0'));
        if(abs>753){
            abs-=753;
        }else{
            abs=753-abs;
        }   
        if(min>abs){
            min=abs;
        }   
        i++;
    }   
    printf("%d\n",min);
    return 0;
}   

Compiler output:
main.c: In function 'main':
main.c:8:9: error: 'x' undeclared (first use in this function)
    8 |         x=(int)((s[i]-'0')*100+(s[i+1]-'0')*10+(s[i+2]-'0'));
      |         ^
main.c:8:9: note: each undeclared identifier is reported only once for each function it appears in
Language: C++

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


int main(){
    string s;
    cin >> s;
    int ans = 1000000;
    
    for(int i = 0;i<s.length();i++){
        //100の位i-1桁
        for(int j = i;j<s.length();j++){
            for(int k = j;k<s.length();k++){
                ans = min(ans,abs(753-s[i]*100-s[j]*10-s[k]);
            }
        }
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:15:61: error: expected ')' before ';' token
   15 |                 ans = min(ans,abs(753-s[i]*100-s[j]*10-s[k]);
      |                          ~                                  ^
      |                                                             )
Language: C++

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

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

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: redeclaration of 'int ans'
   10 |   int N,ans=999;
      |         ^~~
a.cc:7:9: note: 'int ans' previously declared here
    7 |   int x,ans;
      |         ^~~
Language: C++

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

signed main(){

    string s; cin >> s;
    int n = (int)s.size();
    int ans = 1000000007;
    for(int i = 0; i < n - 3; i++){
        string t = s.substr(i, 3);
        ans = min(ans, (int)abs(753 - stoi(t));
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:12:47: error: expected ')' before ';' token
   12 |         ans = min(ans, (int)abs(753 - stoi(t));
      |                  ~                            ^
      |                                               )
Language: C++

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

int main() {
    string s;
    cin >> s;

    int res = 1000;
    stringstream ss;
    for (int i = 0; i < s.size() - 3; i++) {
        string str = s.substr(i, 3);
        ss << str
        int num;
        ss >> num;
        int dif = abs(753 - num);
        if (res > dif) res = dif;
    }

    cout << res << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:18: error: expected ';' before 'int'
   14 |         ss << str
      |                  ^
      |                  ;
   15 |         int num;
      |         ~~~       
a.cc:16:15: error: 'num' was not declared in this scope; did you mean 'enum'?
   16 |         ss >> num;
      |               ^~~
      |               enum
Language: C++

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

int main() [
    string s;
    cin >> s;

    int res = 1000;
    stringstream ss;
    ss << s;
    for (int i = 0; i < s.size(); i++) {
        string str = s.substr(i, 3);
        int num;
        ss >> num;
        int dif = abs(753 - num);
        if (res > dif) res = dif;
    }

    cout << res << endl;
]

Compiler output:
a.cc:7:12: error: expected primary-expression before 's'
    7 |     string s;
      |            ^
a.cc:7:11: error: expected ']' before 's'
    7 |     string s;
      |           ^~
      |           ]
a.cc:8:5: error: 'cin' does not name a type
    8 |     cin >> s;
      |     ^~~
a.cc:12:5: error: 'ss' does not name a type
   12 |     ss << s;
      |     ^~
a.cc:13:5: error: expected unqualified-id before 'for'
   13 |     for (int i = 0; i < s.size(); i++) {
      |     ^~~
a.cc:13:21: error: 'i' does not name a type
   13 |     for (int i = 0; i < s.size(); i++) {
      |                     ^
a.cc:13:35: error: 'i' does not name a type
   13 |     for (int i = 0; i < s.size(); i++) {
      |                                   ^
a.cc:21:5: error: 'cout' does not name a type
   21 |     cout << res << endl;
      |     ^~~~
a.cc:22:1: error: expected unqualified-id before ']' token
   22 | ]
      | ^
Language: C++

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

int main(){
    string u;
  	int minTmp = 99999999;
  
  	cin >> u;
    for (int i=0; i<(u.length-2); i++){
        int tmp = u[i]*100 + u[i+1]*10 + u[i] -753;
        minTmp = min(abs(tmp),minTmp);    
    }  
  
    return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:24: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   10 |     for (int i=0; i<(u.length-2); i++){
      |                      ~~^~~~~~
      |                              ()
Language: C++

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

int main(){
    string u;
  	int minTmp = 99999999;
  
  	cin >> u;
    for (int i=0; i<(u.length)-2; i++){
        int tmp = u[i]*100 + u[i+1]*10 + u[i] -753;
        minTmp = min(abs(tmp),minTmp);    
    }  
  
    return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:24: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   10 |     for (int i=0; i<(u.length)-2; i++){
      |                     ~~~^~~~~~~
      |                               ()
Language: C++

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

int main(){
    string u;
  	int minTmp = 9999999999;
  
  	cin >> u;
    for (int i=0; i<u.length-2; i++){
        int tmp = u[i]*100 + u[i+1]*10 + u[i] -753;
        minTmp = min(abs(tmp),minTmp);    
    }  
  
    return 0; 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:22: warning: overflow in conversion from 'long int' to 'int' changes value from '9999999999' to '1410065407' [-Woverflow]
    7 |         int minTmp = 9999999999;
      |                      ^~~~~~~~~~
a.cc:10:23: error: invalid use of member function 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::size_type std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::length() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>; size_type = long unsigned int]' (did you forget the '()' ?)
   10 |     for (int i=0; i<u.length-2; i++){
      |                     ~~^~~~~~
      |                             ()
Language: C

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define min(a,b) ((a)<(b)?(a):(b))
#define abs(a) ((a)>(0)?(a):-(a))
int main(){
  char a[12];
  scanf("%s",a);
  int l=strlen(a);
  int ans=999,num,i;
  for(i=0;i<l-2;i++){
    num=0;
    num+=((int)a[i]-48)*100;
    num+=((int)a[i+1]-48)*10;
    num+=(int)a[i+2]-48
    ans=min(ans,abs(753-num));
  }
  printf("%d",ans);
}

Compiler output:
main.c: In function 'main':
main.c:15:24: error: expected ';' before 'ans'
   15 |     num+=(int)a[i+2]-48
      |                        ^
      |                        ;
   16 |     ans=min(ans,abs(753-num));
      |     ~~~
Language: C++

#include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;

int main() {
  string s;
  cin>>s;
  int max=0;
  for(int i=0;i<s.size()-3;i++){
    int a=100*(s.[i]-'0')+10*(s.[i+1]-'0')+(s.[i+2]-'0');
    if(abs(753-max)>abs(753-a)) max=a;
  }
  
  cout<<abs(753-max)<<endl;

}


Compiler output:
a.cc: In function 'int main()':
a.cc:12:18: error: expected unqualified-id before '[' token
   12 |     int a=100*(s.[i]-'0')+10*(s.[i+1]-'0')+(s.[i+2]-'0');
      |                  ^
a.cc:12:33: error: expected unqualified-id before '[' token
   12 |     int a=100*(s.[i]-'0')+10*(s.[i+1]-'0')+(s.[i+2]-'0');
      |                                 ^
a.cc:12:47: error: expected unqualified-id before '[' token
   12 |     int a=100*(s.[i]-'0')+10*(s.[i+1]-'0')+(s.[i+2]-'0');
      |                                               ^
Language: C++

#include <bits/stdc++.h>
#define ALL(v) v.begin(), v.end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;

int main() {
  string s;
  cin>>s;
  int max=0;
  for(int i=0;i<s.size()-3:i++){
    int a=100*(s.[i]-'0')+10*(s.[i+1]-'0')+s.[i+2]-'0';
    if(abs(753-max)>abs(753-a)) max=a;
  }
  
  cout<<abs(753-max)<<endl;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:11:15: warning: range-based 'for' loops with initializer only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
   11 |   for(int i=0;i<s.size()-3:i++){
      |               ^
a.cc:11:27: error: expected ';' before ':' token
   11 |   for(int i=0;i<s.size()-3:i++){
      |                           ^
      |                           ;
a.cc:18:1: error: expected primary-expression before '}' token
   18 | }
      | ^
a.cc:16:28: error: expected ')' before '}' token
   16 |   cout<<abs(753-max)<<endl;
      |                            ^
      |                            )
   17 | 
   18 | }
      | ~                           
a.cc:11:6: note: to match this '('
   11 |   for(int i=0;i<s.size()-3:i++){
      |      ^
a.cc:18:1: error: expected primary-expression before '}' token
   18 | }
      | ^
Language: C++

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

using namespace std;

int sum(vector<int>& vec);

int main()
{
	string input;
	cin >> input;

	int min = INT_MAX;
	for (int i = 0; i < (input.length()-3); ++i)
	{
		string sub = input.substr(i, 3);
		int num = atoi(sub.c_str());
		int diff = abs(753 - num);
		if (diff < min)
		{
			min = diff;
		}
	}
	cout << min << endl;
}

Compiler output:
a.cc:8:9: error: 'vector' was not declared in this scope
    8 | int sum(vector<int>& vec);
      |         ^~~~~~
a.cc:4:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
    3 | #include <climits>
  +++ |+#include <vector>
    4 | #include <string>
a.cc:8:16: error: expected primary-expression before 'int'
    8 | int sum(vector<int>& vec);
      |                ^~~
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() - 3; ++i)
  {
    int tmp = atoi(s.substr(i, 3).c_str());
    tmp = (tmp >= 753 ? tmo - 753 : 753 - tmp);
    if(ans > tmp) ans = tmp;
  }
  cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:25: error: 'tmo' was not declared in this scope; did you mean 'tmp'?
   13 |     tmp = (tmp >= 753 ? tmo - 753 : 753 - tmp);
      |                         ^~~
      |                         tmp
Language: C

#include<stdio.h>
int main(void){
  int i=0,t,judge=753;
  char S[11]='';
  scanf("%s",S);
  while((S[i+2]>='0' && S[i+2]<= '9') || S[i+2]!='\0'){
    t=(S[i]-16)*100+(S[i+1]-16)*10+(S[i+2]-16);
    if(753<t){
      if(t-753<judge){
        judge=t-753;
      }
    }else{
      if(753-t<judge){
      	judge=753-t;
      }
    }
    i++;
  }
  printf("%d\n",judge);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:14: error: empty character constant
    4 |   char S[11]='';
      |              ^~
main.c:4:14: error: invalid initializer
Language: C

#include<stdio.h>
int main(void){
  int i=0,t,judge=753;
  char S[11]={''};
  scanf("%s",S);
  while((S[i+2]>='0' && S[i+2]<= '9') || S[i+2]!='\0'){
    t=(S[i]-16)*100+(S[i+1]-16)*10+(S[i+2]-16);
    if(753<t){
      if(t-753<judge){
        judge=t-753;
      }
    }else{
      if(753-t<judge){
      	judge=753-t;
      }
    }
    i++;
  }
  printf("%d\n",judge);
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:4:15: error: empty character constant
    4 |   char S[11]={''};
      |               ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;cin>>s;
  int n=s.size();
  int a=999;
  for(int i=0;i<n-3;i++){
    int number=(s[i]-'0')*100+(s[i+1]-'0')*10+(s[i+2]-'0');
    a=min(a,abs(number-753));}
  cout<<number;}

Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'number' was not declared in this scope
   10 |   cout<<number;}
      |         ^~~~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;cin>>s;
  int n=s.size();
  int a==999;
  for(int i=0;i<n-3;i++){
    int number=(s[i]-'0')*100+(s[i+1]-'0')*10+(s[i+2]-'0');
    a=min(a,abs(number-753));}
  cout<<number;}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:8: error: expected initializer before '==' token
    6 |   int a==999;
      |        ^~
a.cc:9:5: error: 'a' was not declared in this scope
    9 |     a=min(a,abs(number-753));}
      |     ^
a.cc:10:9: error: 'number' was not declared in this scope
   10 |   cout<<number;}
      |         ^~~~~~
Language: C++

#include<stdio.h>
int main()
{
  int min=1000,i;
  char a[10];
  scanf("%s",a);
  for(i=0; i<8; i++){
    if(min>abs(100*(a[i]-'0')+10*(a[i+1]-'0')+(a[i+2]-'0')-753)){
      min=abs(100*(a[i]-'0')+10*(a[i+1]-'0')+(a[i+2]-'0')-753);
    }
  }
  printf("%d\n",min);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:8:12: error: 'abs' was not declared in this scope
    8 |     if(min>abs(100*(a[i]-'0')+10*(a[i+1]-'0')+(a[i+2]-'0')-753)){
      |            ^~~
Language: C++

#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
int main(){
  char s[11];
  cin>>s;
  int mini=1000;
  for(int i=0;i<=strlen(s)-3;i++){
    mini=min(abs(753-((s[i]-'0')*100+(s[i+1]-'0')*10+(s[i+2]-'0'))),mini);
  }
  cout<<mini<<"\n";
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:9:18: error: 'strlen' was not declared in this scope
    9 |   for(int i=0;i<=strlen(s)-3;i++){
      |                  ^~~~~~
a.cc:4:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<algorithm>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

s = input()
num = 0
ans_num = 10000
for x in s:
    num *= 10
    num += int(x)
    num = num % 1000
    if abs(ans_num - 753) > abs(num - 753):
        ans_num = num
print(abs(ans_num - 753))


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

#include <iostream>
#include <string>

using namespace std;

void a() {
	int x;
	cin >> x;
	cout << ((x == 3 || x == 5 | x == 7) ? "YES" : "NO") << endl;
}

void b() {
	char s[11];
	cin >> s;
	int min = 999;
	for (int i = 0; i <= (signed)(strlen(s) - 3); i++) {
		int t = 0;
		t += (s[i] - '0') * 100;
		t += (s[i + 1] - '0') * 10;
		t += (s[i + 2] - '0') * 1;
		int tmin = (t > 753) ? t-753: 753-t;
		if (tmin < min)
			min = tmin;
	}
	cout << min << endl;
}

int main()
{
	b();
}



Compiler output:
a.cc: In function 'void b()':
a.cc:16:39: error: 'strlen' was not declared in this scope
   16 |         for (int i = 0; i <= (signed)(strlen(s) - 3); i++) {
      |                                       ^~~~~~
a.cc:2:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    1 | #include <iostream>
  +++ |+#include <cstring>
    2 | #include <string>
Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:11:20: error: 'c' was not declared in this scope
   11 |                 a=(c[i]-'0')*100+(c[i+1]-'0')*10+c[i+2]-'0';
      |                    ^
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:2: error: 'cout' does not name a type
   15 |  cout <<
      |  ^~~~
a.cc:16:2: 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));
      |            ^~
a.cc:22:2: error: expected declaration before '}' token
   22 |  }
      |  ^
a.cc:23:1: error: expected declaration before '}' token
   23 | }
      | ^
Language: C++

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

int main(){
  string s;
  int mini=10000;
  cin >> s;
  for(int i=0;i<s.size()-2;i++){
  v= abs(753-((s[i]-'0')*100+(s[i+1]-'0')*10+(s[i+2]-'0')));
  if(mini>v){
    mini=v;
  }
  }
  cout << mini << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'v' was not declared in this scope
    9 |   v= abs(753-((s[i]-'0')*100+(s[i+1]-'0')*10+(s[i+2]-'0')));
      |   ^
Language: C++

#include <iostream>

int main() {
    std::string S;
    std::cin >> S;

    int diff = INT_MAX;
    for (unsigned long i = 0; i < S.size() - 2; i++) {
        int var = abs(753 - std::stoi(S.substr(i, 3)));
        if (diff > var) {
            diff = var;
        }
        if (diff == 0) {
            break;
        }
    }
    std::cout << diff << std::endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:7:16: error: 'INT_MAX' was not declared in this scope
    7 |     int diff = INT_MAX;
      |                ^~~~~~~
a.cc:2:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    1 | #include <iostream>
  +++ |+#include <climits>
    2 |
Language: C++

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

int main(){
  int s;
  cin >> s;
  vector<int>vec(8);
  for  (int i = 0; i < 8; i++){
    int a, b;
    a = 1e(i+3);
    b = 1ei
    vector.at(i) = (s%a) - (s%b);
  }
  for (int i = 0; i < 8; i++){
    vector.at(i) = abs(vector.at(i)-753);
  }
  sort(vec.begin(), vec.end());
  cout << vec.at(0);
}
  
    
   

Compiler output:
a.cc:10:9: error: exponent has no digits
   10 |     a = 1e(i+3);
      |         ^~
a.cc:11:9: error: exponent has no digits
   11 |     b = 1ei
      |         ^~~
a.cc: In function 'int main()':
a.cc:15:11: error: expected unqualified-id before '.' token
   15 |     vector.at(i) = abs(vector.at(i)-753);
      |           ^
Language: C++

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

int main(){
  string s;
  cin >> s;
  int i=s.size(),a,b,c,mini=-100,v;
  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());
    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());
      |                   ^~~~~