Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <algorithm>
#include <stdint.h>
#include <queue>
#include <bitset>
#include <iomanip>
#define PI (3.14159265358979323846)
#define INF (1e+9)
#define DIV_NUM (1000000007)

using namespace std;

int main()
{

	/*--------------------------------*/
		/* 数字宣言と入力*/
		
		
//    string iS,iT,iU;
	char S ,T;
	cin >> S >> T;

		
	int a, b;
	
	cin >> a >>b;
	
	char u ;
	
	cin >>u;
	
	if(u==s){
//		tmpX = a-1;
		cout << a-1 << b << endl;
	}
	
	elseif(u==t){
		cout << a << b-1 << endl;
	}
	else{
		cout << a << b << endl;
		
	}



	/*---------------------------------*/
		/* 出力 */
//	cout << tmpX << endl;


	/*----------------------------------*/
	return 0;
}






































//////////////////////////////////////////
int main()
{
	
/*--------------------------------*/
//	/* 文字列 */
//    string input;
//    /* 文字列入力 */
//    cin >> input;    
//    /* 文字列ソート */
//    sort(input.begin(), input.end());

/*--------------------------------*/
    /* 数字宣言と入力*/
    int s, k , tmpX,tmpY,maxLine;
    /*個数　*/
	cin >> s >> k ;
	
//	/* ベクトル宣言　↑で入力したｎ数 */
//	vector<int> vecX(n);
//	vector<int> vecY(n);	
	
	/* ベクトルに入力 */
	for (int i = 0; i < k; i++)
	{
//	 cin >> tmpX >> tmpY;
//	 vecX[i] = tmpX;
//	 cin >> tmpY;
//	 vecY[i] = tmpY;

//     /* ↑と同じ入力の仕方 */
//     vec.push_back(tmp);
	}

//	/* ベクトル使うには */
//	int max_abc = vec[n/ 2 - 1];
	
	
	/* for,if, &&,|| */

    for (int i = 0; i < n-2; i++)
    {
		for(int a=i+1; a<n ;a++)
		{
			maxLine = sqrt((vecX[i]-vecX[i+a+1])^2+(vecY[i]-vecY[i+a+1])^2);
			maxLineFin = max( maxLineFin , maxLine );
		}
    }
			
			
//	/* 違う書き方 */		
//	for (int i = 1; i < n-1; i++) {			
//       if ( ( input[i - 1] < input[i] )
//           &&( input[i] < input[i + 1] )) {
//            count++;
//        }
//        else if( ( input[i - 1] > input[i] )
//        	   &&( input[i] > input[i + 1] ) ) {
//            count++;
//        }
//    }
    
    /**/
//   if( ( input[0] == input[1] )
//     &&( input[2] == input[3] )
//     &&( input[1] != input[2] )) {
//        cout << "Yes" << endl;
//    } else {
//        cout << "No" << endl;
//    }

	
	
/*---------------------------------*/
    /* 出力 */
    cout << maxLineFin << endl;


/*----------------------------------*/
    return 0;
}




int main()
{

	/*--------------------------------*/
		/* 数字宣言と入力*/
	int n, tmpX, tmpY;
	double maxLine, maxLineFin;
	/*個数　*/
	cin >> n;
	/* ベクトル宣言　↑で入力したｎ数 */
	vector<int> vecX(n);
	vector<int> vecY(n);

	/* ベクトルに入力 */
	for (int i = 0; i < n; i++)
	{
		cin >> tmpX >> tmpY;
		vecX[i] = tmpX;
		//	 cin >> tmpY;
		vecY[i] = tmpY;

		//     /* ↑と同じ入力の仕方 */
		//     vec.push_back(tmp);
	}

//	/* ベクトル使うには */
//	int max_abc = vec[n / 2 - 1];


	/* for,if, &&,|| */
	maxLine = 0.0;
	maxLineFin = 0.0;

	for (int i = 0; i < n ; i++)
	{
		for (int a = i+1; a < n ; a++)
		{
			maxLine = sqrt( (vecX[i] - vecX[a]) ^2 + (vecY[i] - vecY[a]) ^ 2 );
			maxLineFin = max( maxLineFin, maxLine );
		}
	}



	/*---------------------------------*/
		/* 出力 */
	cout << maxLineFin << endl;


	/*----------------------------------*/
	return 0;
}



#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <algorithm>
#include <stdint.h>
#include <queue>
#include <bitset>
#include <iomanip>
#define PI (3.14159265358979323846)
#define INF (1e+9)
#define DIV_NUM (1000000007)

using namespace std;


int main()
{

	/*--------------------------------*/
		/* 数字宣言と入力*/
	int k, s, cnt = 0;
	//	double maxLine, maxLineFin;
		/*個数　*/
	cin >> k >> s;
	/* ベクトル宣言　↑で入力したｎ数 */
	vector<int> vecX(k);
	vector<int> vecY(k);
	vector<int> vecZ(k);

	/* ベクトルに入力 */
	for (int i = 0; i <= k; i++)
	{
		//		cin >> tmpX >> tmpY;
		vecX[i] = i;
		//	 cin >> tmpY;
		vecY[i] = i;
		vecZ[i] = i;

		//     /* ↑と同じ入力の仕方 */
		//     vec.push_back(tmp);
	}

	//	/* ベクトル使うには */
	//	int max_abc = vec[n / 2 - 1];


		/* for,if, &&,|| */
//	maxLine = 0.0;
//	maxLineFin = 0.0;

	for (int i = 0; i <= k; i++)
	{
		for (int a = 0; a <= k; a++)
		{
//			for (int b = 0; b <= k; b++)
//			{
				z = s + vecX[a] + vecX[b]);
				if((z>=0) && (z<=k)){
					cnt++;
				}
//				}
			}
		}
	}



	/*---------------------------------*/
		/* 出力 */
	cout << cnt << endl;


	/*----------------------------------*/
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:15: error: 's' was not declared in this scope
   36 |         if(u==s){
      |               ^
a.cc:41:19: error: 't' was not declared in this scope
   41 |         elseif(u==t){
      |                   ^
a.cc:41:9: error: 'elseif' was not declared in this scope
   41 |         elseif(u==t){
      |         ^~~~~~
a.cc:44:9: error: 'else' without a previous 'if'
   44 |         else{
      |         ^~~~
a.cc: At global scope:
a.cc:98:5: error: redefinition of 'int main()'
   98 | int main()
      |     ^~~~
a.cc:16:5: note: 'int main()' previously defined here
   16 | int main()
      |     ^~~~
a.cc: In function 'int main()':
a.cc:137:25: error: 'n' was not declared in this scope
  137 |     for (int i = 0; i < n-2; i++)
      |                         ^
a.cc:141:41: error: 'vecX' was not declared in this scope
  141 |                         maxLine = sqrt((vecX[i]-vecX[i+a+1])^2+(vecY[i]-vecY[i+a+1])^2);
      |                                         ^~~~
a.cc:141:65: error: 'vecY' was not declared in this scope
  141 |                         maxLine = sqrt((vecX[i]-vecX[i+a+1])^2+(vecY[i]-vecY[i+a+1])^2);
      |                                                                 ^~~~
a.cc:142:25: error: 'maxLineFin' was not declared in this scope; did you mean 'maxLine'?
  142 |                         maxLineFin = max( maxLineFin , maxLine );
      |                         ^~~~~~~~~~
      |                         maxLine
a.cc:172:13: error: 'maxLineFin' was not declared in this scope; did you mean 'maxLine'?
  172 |     cout << maxLineFin << endl;
      |             ^~~~~~~~~~
      |             maxLine
a.cc: At global scope:
a.cc:182:5: error: redefinition of 'int main()'
  182 | int main()
      |     ^~~~
a.cc:16:5: note: 'int main()' previously defined here
   16 | int main()
      |     ^~~~
a.cc:253:5: error: redefinition of 'int main()'
  253 | int main()
      |     ^~~~
a.cc:16:5: note: 'int main()' previously defined here
   16 | int main()
      |     ^~~~
a.cc: In function 'int main()':
a.cc:294:33: error: 'z' was not declared in this scope
  294 |                                 z = s + vecX[a] + vecX[b]);
      |                                 ^
a.cc:294:56: error: 'b' was not declared in this scope
  294 |                                 z = s + vecX[a] + vecX[b]);
      |                                                        ^
a.cc: At global scope:
a.cc:307:9: error: 'cout' does not name a type
  307 |         cout << cnt << endl;
      |         ^~~~
a.cc:311:9: error: expected unqualified-id before 'return'
  311 |         return 0;
      |         ^~~~~~
a.cc:312:1: error: expected declaration before '}' token
  312 | }
      | ^