Language: C++

#include <iostream>
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include <cstring>
#define MAXV 2000
#define PI 3.14159265358979323846
#define eps 1e-8
#define zero(x) (fabs(x)<eps)
#define SGN(x) ((x)>eps?1:((x)>-eps?0:-1))
#define _sign(x) ((x)>eps?1:((x)<-eps?2:0))
using namespace std;

//莠檎サエ轤ケ
struct pt
{
	double x, y;
	pt(){}
	pt(double _x, double _y):x(_x), y(_y){}
	pt operator - (const pt p1){return pt(x - p1.x, y - p1.y);}
	pt operator + (const pt p1){return pt(x + p1.x, y + p1.y);}
	pt operator * (double s){return pt(x * s, y * s);}
	pt operator / (double s){return pt(x / s, y / s);}
	bool operator < (const pt p1)const{return y < p1.y-eps || y < p1.y+eps && x < p1.x;}
	bool operator == (const pt p1)const{return !SGN(y - p1.y) && !SGN(x - p1.x);}
	bool operator != (const pt p1)const{return SGN(y - p1.y) || SGN(x - p1.x);}
	void read(){scanf("%lf %lf", &x, &y);}
};

//荳、轤ケ霍晉ヲサ
double vlen(const pt &a){return sqrt(a.x*a.x+a.y*a.y);}
double dis(const pt &a, const pt &b){return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));}
//轤ケv扈慕捩轤ケp騾?慮髓域雷霓ャangle蟷カ謾セ螟ァscale蛟?pt rotatee(pt v, pt p, double angle, double scale)
{
	pt ret = p;
	v.x -= p.x;
	v.y -= p.y;
	p.x = scale * cos(angle);
	p.y = scale * sin(angle);
	ret.x += v.x * p.x - v.y * p.y;
	ret.y += v.x * p.y + v.y * p.x;
	return ret;
}


int main()
{
    int i, n;
    pt lef, rig;
    double d,d1,d2,v1,v2,t,x;
    pt v,z,theta;
    while (cin >> n >> d && !(n==0 && d==0))
    {
        lef = pt(-d,0);
        rig = pt(d,0);
        for (i=1;i<=n;i++)
        {
            cin >> v1 >> v2 >> t;
            d1 = (t*v1)/180*PI;
            d2 = (t*v2)/180*PI;
            if (SGN(d1-d2)==0)
            {
                v.x = rig.y - lef.y;
                v.y = rig.x - lef.x;
                v = v/vlen(v);
                v.x = fabs(v.x);
                v.y = fabs(v.y);
                lef = lef + v*d1;
                rig = rig + v*d2;
            }
            else if (d1*d2<0)
            {
                z = lef+(rig-lef)*fabs(d1)/(fabs(d1)+fabs(d2));
                lef = rotatee(lef,z,-d1/dis(lef,z),1);
                rig = rotatee(rig,z,d2/dis(rig,z),1);
            }
            else {
                if (fabs(d1)>fabs(d2))
                {
                    x = 2*d*fabs(d2)/(fabs(d1)-fabs(d2));
                    z = rig + (rig-lef)/2/d*x;
                    lef = rotatee(lef,z,-d1/dis(lef,z),1);
                    rig = rotatee(rig,z,-d2/dis(rig,z),1);
                }
                else {
                    x = 2*d*fabs(d1)/(fabs(d2)-fabs(d1));
                    z =  lef+ (lef-rig)/2/d*x;
                    lef = rotatee(lef,z,d1/dis(lef,z),1);
                    rig = rotatee(rig,z,d2/dis(rig,z),1);
                }
            }
        }
        printf("%.4f\n%.4f\n",(lef.x+rig.x)/2,(lef.y+rig.y)/2);
    }
    return 0;
}

Compiler output:
a.cc:34:1: error: expected unqualified-id before '{' token
   34 | {
      | ^
a.cc: In function 'int main()':
a.cc:74:23: error: 'rotatee' was not declared in this scope
   74 |                 lef = rotatee(lef,z,-d1/dis(lef,z),1);
      |                       ^~~~~~~
a.cc:82:27: error: 'rotatee' was not declared in this scope
   82 |                     lef = rotatee(lef,z,-d1/dis(lef,z),1);
      |                           ^~~~~~~
a.cc:88:27: error: 'rotatee' was not declared in this scope
   88 |                     lef = rotatee(lef,z,d1/dis(lef,z),1);
      |                           ^~~~~~~