Language: C++

#include <iostream>
#include <cmath>
#include <algorithm>

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:6:9: error: 'string' was not declared in this scope
    6 |         string s;
      |         ^~~~~~
a.cc:6:9: 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:7:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    7 |         cin>>s;
      |         ^~~
      |         std::cin
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:7:14: error: 's' was not declared in this scope
    7 |         cin>>s;
      |              ^
a.cc:11:17: error: 'a' was not declared in this scope
   11 |                 a=(c[i]-'0')*100+(c[i+1]-'0')*10+c[i+2]-'0';
      |                 ^
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';
      |                    ^
a.cc:12:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |         ans=min(ans,abs(a-753));
      |         ^~~
      |         abs
a.cc:12:13: error: 'min' was not declared in this scope; did you mean 'std::min'?
   12 |         ans=min(ans,abs(a-753));
      |             ^~~
      |             std::min
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:3:
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: 'std::min' declared here
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
a.cc:15:9: 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:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
   15 |         cout<<ans<<endl;
      |               ^~~
      |               abs
a.cc:15:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   15 |         cout<<ans<<endl;
      |                    ^~~~
      |                    std::endl
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~