Go: package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
	"strings"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextFloat64() (float64, error) {
	return strconv.ParseFloat(nextString(), 64)
}

func main() {
	scanner.Split(bufio.ScanWords)

	x, y := 0.0, 0.0
	rotate := 90.0

	for {
		line := nextString()
		if line == "0,0" {
			break
		}

		numbers := strings.Split(line, ",")
		di, _ := strconv.ParseFloat(numbers[0], 64)
		ai, _ := strconv.ParseFloat(numbers[1], 64)

		rotateRadian := math.Pi * rotate / 180.0
		x += di * math.Cos(rotateRadian)
		y += di * math.Sin(rotateRadian)

		rotate -= ai

		// fmt.Println(x, y)
	}

	fmt.Println(int(x))
	fmt.Println(int(y))
}

C++: #include <stdio.h>
#include <math.h>
#define M_PI 3.141592653589793
#pragma warning(disable:4996)
int main(){
	double x = 0,y = 0;
	int a,b,c=90;

	while(true){
		scanf("%d,%d",&a,&b);
		if(a == 0 && b == 0)break;
		x += a*cos(c*M_PI/180);
		y += a*sin(c*M_PI/180);
		c -= b;
	}
	printf("%d\n%d\n",(int)x,(int)y);
    return 0;
}

C++: #include <cmath>
#include <iostream>
#include <cstdio>

const double PI = 3.14159265358979323846;

struct Vec2
{
	double x;
	double y;
	Vec2( double ix, double iy ):x(ix),y(iy){}
};

class Turtle
{
	Vec2 pos;
	double angle;
public:
	void forward(double length)
	{
		pos.x += length * cos(angle);
		pos.y += length * sin(angle);
	}
	void rotate( double angle1 )
	{
		angle -= angle1;
	}
	Vec2 GetPos(){return pos;}
	Turtle() : pos(Vec2(0.0,0.0)), angle(0.0){}
	Turtle( Vec2 v, double a ) : pos(v), angle(a){}
};

int main()
{
	Turtle turtle;
	int l,a;
	while(scanf("%d,%d",&l,&a),l||a)
	{
		turtle.forward(l);
		turtle.rotate(a*PI/180.0);
	}

	int x = static_cast<int>( turtle.GetPos().x );
	int y = static_cast<int>( turtle.GetPos().y );
	std::cout << x << '\n' << y;
}

C++: #include <iostream>
#include <cmath>
#define PI 3.16
using namespace std;
int main() {
  int len, rot;
  float x, y, shita;
  x = y = shita = 0;
  while(1) {
    scanf("%d,%d", len, rot);
    if (len == 0 && rot == 0) {
      break;
    }
    x += cos(shita * PI / 180);
    y += sin(shita * PI / 180);
    shita += rot;
  }
  cout << x <<  endl;
  cout << y << endl;
  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rad(x) x * M_PI / 180

int main(){
  double x = 0.0;
  double y = 0.0;
  int angle = 0.0;
  int d = 0;
  int r = 0;

  while (1){
    scanf("%d, %d", &r, &d);
    if (r == 0 && d == 0) break;
    y += r * sin(rad(angle));
    x += r * cos(rad(angle));

    angle += d;
  }

  printf("%d\n%d\n", (int)y, (int)x);
  return 0;
}

C++: #include <iostream>
#include <cmath>

using namespace std;

int main()
{
    int s, d;
    char dummy;

    double px = 0.0, py = 0.0;
    double dir = 90.0;

    while( cin >> s >> dummy >> d ) {
        if ( s == 0 && d == 0 )
            break;

        px += cos( dir * M_PI / 180.0 ) * s;
        py += sin( dir * M_PI / 180.0 ) * s;
        dir -= d;
    }

    cout << static_cast<int>( px ) << endl << static_cast<int>( py ) << endl;
}

C++: #include<cstdio>
#include<iostream>
#include<cmath>
using namespace std;
#define pi 3.14


int main()
{
	int x = 0, y = 0;
	double d = 0, a = 90, r = 360;
	while (d != 0 || r != 0) {
		scanf("%lf,%lf", &d, &r);
		x = x + d * cos(a / 360 * 2 * pi);
		y = y + d * sin(a / 360 * 2 * pi);
		a = a + r;
	}
	cout << x << endl << y << endl;
    return 0;
}

C++: #include<stdio.h>
#include<math.h>
#define M_PI 3.14159265358979

int main()
{
	int x=1,y=1;
	double r=90,k=0,h=0;
	for(;x!=0||y!=0;)
	{
		scanf("%d,%d",&x,&y);
		k+=x*sin(r*M_PI/180.0);
		h+=x*cos(r*M_PI/180.0);
		r-=y;
	}
	printf("%.0f\n%.0f\n",h,k);
	return 0;
}

C++: 
#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <cstring>
#include <vector>
#include <map>
#include <utility>
#include <complex>
#include <stack>

using namespace std;

typedef complex<double> P;

int main(){

	double x=0,y=0;
	double c_th = 90;
	double r,th; char c;
	while(cin>>r>>c>>th,(r||th)){
		x += r * cos(c_th * M_PI / 180);
		y += r * sin(c_th * M_PI / 180);
		c_th -= th;
	}

	cout << (int)x << " " << (int)y << endl;

	return 0;
}

C++: #include <iostream>
#include <cmath>

using namespace std;

const double Pi = 3.14159265;
const double Degree = Pi / 180;

int main(int argc, char const* argv[])
{
	double scale,dTheta,theta;
	double x,y;
	char comma;
	x = y = 0;
	theta = 0;

	while( cin >> scale >> comma >> dTheta && scale != 0 ){
		x += scale * cos( -theta * Degree );
		y += scale * sin( -theta * Degree );
		theta += dTheta;
	}
	cout << static_cast<int>(-y) << endl;
	cout << static_cast<int>(x) << endl;
	return 0;
}

C++: #include <stdio.h>
#include <math.h>

int dtoi(double d)
{
  return d>0 ? floor(d) : ceil(d);
}

int main(void)
{
  double x = 0;
  double y = 0;
  int orientation = 90;
  while(1){
    int step,rotation;
    scanf("%d,%d", &step, &rotation);

    if(step==0 && rotation==0){
      printf("%d\n", dtoi(x));
      printf("%d\n", dtoi(y));
      break;
    }else{
      x += step*cos(orientation*M_PI/180);
      y += step*sin(orientation*M_PI/180);
      orientation -= rotation;
    }
  }

  return 0;
}

C++: #include<stdio.h>
#include<math.h>

typedef long double ldouble;

const double PI = acos(-1.0);
const double eps = 1e-10;
int main()
{
	int d,t;
	double x=0,y=0;
    int dir = 0;
	while(scanf("%d,%d", &d, &t) &&(d||t))			//霎灘?0,0扈捺據
	{
	    double tt = dir * PI / 180.0;
		x -= d * sin(tt);						//隶。邂?		y += d * cos(tt);
	    dir -= t;
	}
	printf("%d\n%d\n", (int)x, (int)y);					//霎灘?

	return 0;
}

C++: #include<iostream>
#include<cmath>
using namespace std;
double x,y,dir=M_PI/2.0;
int a,b;
char c;
int main(){
  x=y=0.0;
  while(cin>>a>>c>>b&&a){
    x-=cos(dir)*(double)a;
    y+=sin(dir)*(double)a;
    dir+=b/180.0*M_PI;
    while(dir>=2.0*M_PI)dir-=2.0*M_PI;
    while(dir<0.0)dir+=2.0*M_PI;
    
  }
  cout<<(int)x<<endl<<(int)y<<endl;
  return 0;
}

C++: #include<iostream>
#include<string>
#include<vector>
#include<utility>
#include<queue>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<complex>
#define INF 1e9
#define llINF 9223372036854775807
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long

using namespace std;
int main(){
  pair<double,double> now=mp(0.0,0.0);
  int a,b;
  double r=0;
  while(scanf("%d,%d",&a,&b),a+b){
    now.F+=cos((r*M_PI)/180)*a;
    now.S+=sin((r*M_PI)/180)*a;
    r+=b;
  }
  int aa=now.F,bb=now.S;
  cout<<bb<<endl<<aa<<endl;
  return 0;
}

C++: #include<iostream>
#include<cmath>
#include<cstdio>

int main(){
  int a,pre_d=90,d;
  double x=0,y=0;

  while(1){
    scanf(" %d,%d",&a,&d);
    if(a==0&&d==0) break;
    //std::cout << (double)a << (double)d <<std::endl;
    x += (double)a*cos((double)pre_d*M_PI/180);
    y += (double)a*sin((double)pre_d*M_PI/180);
    pre_d += -d;
  }
  //std::cout << (double)a << std::endl;
  printf("%d\n%d\n",(int)x,(int)y);

}