Language: C++


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

#define FOR(i,f,t) for(int i=(int)f; i<(int)t; i++)
#define FORR(i,f,t) for(int i=(int)f; i>(int)t; i--)
#define ms(obj, val) memset(obj, val, sizeof(obj))
#define pb push_back
#define SYNC ios_base::sync_with_stdio(false)
#define inf 100248012
#define mp make_pair
#define F first
#define S second
#define ri(x) scanf("%d",&x)
#define rii(x,y) scanf("%d %d",&x,&y)
#define riii(x,y,z) scanf("%d %d %d",&x,&y,&z)
#define lri(x) scanf("%lld",&x)
#define lrii(x,y) scanf("%lld %lld",&x,&y)
#define lriii(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)


typedef vector<int> vi;
typedef long long ll;
typedef pair<int, int> ii;
double X0;
double Y0;
const int MAXN = 5e3+3;

struct Point{
  double x;
  double y;
  Point(double a = 0, double b = 0){
    x = a,y = b;
  }
  bool operator==(const Point p)const {
    return p.x == x && p.y == y;
  }
  bool operator<(const Point &p) const{
    return y<p.y || (y == p.y && x<p.x);
  }
  bool operator<=(const Point &p) const{
    return y<p.y || (y == p.y && x<=p.x);
  }
  Point operator+( Point p){
    return Point(x+p.x,y+p.y);
  }
  Point operator-( Point p){
    return Point(x-p.x,y-p.y);
  }
  Point operator*( double a){
	  return Point(a*x,a*y);
  }
  double operator*( Point p){
    return x*p.x + y*p.y;
  }
  double operator^( Point p){
    return x*p.y - y*p.x;
  }
  double norma2(){
    return x*x + y*y;
  }
  double norma(){
    return sqrt(this->norma2());
  }
};
struct Recta{
			return Point(inf,inf);
			}
		else{
			double alpha;
			alpha=((M.P-P)^M.V)/(V^M.V);
			return P+V*alpha;
			}
		}
	};
struct Segmento{
	Point P;
	Point V;
	Segmento(Point p=Point(0,0),Point q=Point(0,0)){
		P=p;
		V=q;
		}
	Point operator *(Recta M){
		if(((M.V)^V) == 0){
			return Point(inf,inf);
			}
		else{
			double alpha;
			alpha=((M.P-P)^M.V)/(V^M.V);
			if((alpha<=1)&&(alpha>=0))
			{return P+V*alpha;}
			else
			{return Point(inf,inf);}
			}
		}
	};


int main(){
	int a[3];
	scanf("%d %d %d",&a[0],&a[1],&a[2]);
	sort(a,a+3);
	printf("%d\n",a[0]+a[1]);
	return 0;
	}
	Point P;
	Point V;
	Recta(Point p=Point(0,0),Point q=Point(0,0)){
		P=p;
		V=q;
		}
	Point operator *(Recta M){
		if(((M.V)^V) == 0){
			return Point(inf,inf);
			}
		else{
			double alpha;
			alpha=((M.P-P)^M.V)/(V^M.V);
			return P+V*alpha;
			}
		}
	};
struct Segmento{
	Point P;
	Point V;
	Segmento(Point p=Point(0,0),Point q=Point(0,0)){
		P=p;
		V=q;
		}
	Point operator *(Recta M){
		if(((M.V)^V) == 0){
			return Point(inf,inf);
			}
		else{
			double alpha;
			alpha=((M.P-P)^M.V)/(V^M.V);
			if((alpha<=1)&&(alpha>=0))
			{return P+V*alpha;}
			else
			{return Point(inf,inf);}
			}
		}
	};


int main(){
	int a[3];
	scanf("%d %d %d",&a[0],&a[1],&a[2]);
	sort(a,a+3);
	printf("%d\n",a[0]+a[1]);
	return 0;
	}


Compiler output:
a.cc:67:25: error: expected unqualified-id before 'return'
   67 |                         return Point(inf,inf);
      |                         ^~~~~~
a.cc:68:26: error: expected ';' after struct definition
   68 |                         }
      |                          ^
      |                          ;
a.cc:69:17: error: expected unqualified-id before 'else'
   69 |                 else{
      |                 ^~~~
a.cc:74:17: error: expected declaration before '}' token
   74 |                 }
      |                 ^
a.cc:75:9: error: expected declaration before '}' token
   75 |         };
      |         ^
a.cc: In member function 'Point Segmento::operator*(Recta)':
a.cc:84:24: error: 'struct Recta' has no member named 'V'
   84 |                 if(((M.V)^V) == 0){
      |                        ^
a.cc:89:35: error: 'struct Recta' has no member named 'P'
   89 |                         alpha=((M.P-P)^M.V)/(V^M.V);
      |                                   ^
a.cc:89:42: error: 'struct Recta' has no member named 'V'
   89 |                         alpha=((M.P-P)^M.V)/(V^M.V);
      |                                          ^
a.cc:89:50: error: 'struct Recta' has no member named 'V'
   89 |                         alpha=((M.P-P)^M.V)/(V^M.V);
      |                                                  ^
a.cc: At global scope:
a.cc:108:9: error: ISO C++ forbids declaration of 'Recta' with no type [-fpermissive]
  108 |         Recta(Point p=Point(0,0),Point q=Point(0,0)){
      |         ^~~~~
a.cc: In function 'int Recta(Point, Point)':
a.cc:111:17: warning: no return statement in function returning non-void [-Wreturn-type]
  111 |                 }
      |                 ^
a.cc: At global scope:
a.cc:112:15: error: declaration of 'operator*' as non-function
  112 |         Point operator *(Recta M){
      |               ^~~~~~~~
a.cc:112:31: error: expected ')' before 'M'
  112 |         Point operator *(Recta M){
      |                         ~     ^~
      |                               )
a.cc:122:9: error: expected declaration before '}' token
  122 |         };
      |         ^
a.cc:123:8: error: redefinition of 'struct Segmento'
  123 | struct Segmento{
      |        ^~~~~~~~
a.cc:76:8: note: previous definition of 'struct Segmento'
   76 | struct Segmento{
      |        ^~~~~~~~
a.cc:146:5: error: redefinition of 'int main()'
  146 | int main(){
      |     ^~~~
a.cc:99:5: note: 'int main()' previously defined here
   99 | int main(){
      |     ^~~~