Language: C++

#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <vector>
#include <list>
#include <deque>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <valarray>
#include <utility>
#include <numeric>
#include <memory>
#include <functional>
#include <stdexcept>
#include <typeinfo>
#include <limits>
#include <complex>
#include <locale>
#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif
using namespace std;
#define Debug(x) cerr << #x << " = " << x << endl
#define Debug22(x,y) cerr<<#x<<" = "<<x<<" , "<<#y<<" = "<<y<<endl;
#define Debug2(x, y) cerr << "(" << #x << ", " << #y << ") = (" << x << ", " << y << ")\n";
#define Debug3(x,y,z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = ("<<x<<", "<<y<<", "<<z<<")\n";
#define Debug_arr(v,n) for(int i=0;i<n;++i) cerr<<#v<<"["<<i<<"]"<<" = "<<v[i]<<endl;
#define SET(p,v) fill((__typeof(**p)*)p,(__typeof(**p)*)p+sizeof(p),v);
#define eprintf(...) fprintf(stderr, __VA_ARGS__),fflush(stderr)
#define prl cerr << "called: " << __LINE__ << endl
#define all(s) s.begin(),s.end()
//#define FILE_JUDGE
//#define TIMES
//#define LINES
//#define home
//#define multitests
//#define not_only_test
struct basic_io{
	template<class T> input(T &t) {cin>>t;}
	template<class T> print(T t) {cout<<t;}
	void print() {cout<<endl;}
	template<class T> print(T t[],int n) {
		for (int i=0;i<n;++i)
		{
			print(t[i]);
			if (i!=n-1) print(' ');
		}
		print();
	}
	void multiprint(char c,int x) {cout<<string(x,c);}
	void space(int x) {multiprint(' ',x);}
}_bio;
struct fast_io{
	inline int readint(){
		char c;
		while(c=getchar(),(c<'0'||c>'9')&&c!='-');
		bool flag=(c=='-');
		if(flag)c=getchar();
		int x=0;
		while(c>='0'&&c<='9'){
			x=x*10+c-48;
			c=getchar();
		}
		return flag?-x:x;
	}
};
int n,cnt[100005];
int main()
{
	scanf("%d",&n);
	for (int i=0;i<n;++i)
	{
		int x;
		scanf("%d",&x);
		cnt[x]++;
		cnt[x-1]++;
		cnt[x+1]++;
	}
	int ans=0;
	for (int i=0;i<100005;++i)
	{
		ans=max(ans,cnt[i]);
	}
	printf("%d\n",ans);
	return 0;
}


Compiler output:
a.cc:87:27: error: ISO C++ forbids declaration of 'input' with no type [-fpermissive]
   87 |         template<class T> input(T &t) {cin>>t;}
      |                           ^~~~~
a.cc:88:27: error: ISO C++ forbids declaration of 'print' with no type [-fpermissive]
   88 |         template<class T> print(T t) {cout<<t;}
      |                           ^~~~~
a.cc:90:27: error: ISO C++ forbids declaration of 'print' with no type [-fpermissive]
   90 |         template<class T> print(T t[],int n) {
      |                           ^~~~~
a.cc: In member function 'int basic_io::input(T&)':
a.cc:87:47: warning: no return statement in function returning non-void [-Wreturn-type]
   87 |         template<class T> input(T &t) {cin>>t;}
      |                                               ^
a.cc: In member function 'int basic_io::print(T)':
a.cc:88:47: warning: no return statement in function returning non-void [-Wreturn-type]
   88 |         template<class T> print(T t) {cout<<t;}
      |                                               ^
a.cc: In member function 'int basic_io::print(T*, int)':
a.cc:97:9: warning: no return statement in function returning non-void [-Wreturn-type]
   97 |         }
      |         ^