Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	var x, y float64
	angle := 90.0

	for sc.Scan() {
		data := strings.Split(sc.Text(), ",")
		if data[0] == "0" && data[1] == "0" {
			break
		}
		meters, _ := strconv.Atoi(data[0])
		m := float64(meters)
		changedAngle, _ := strconv.Atoi(data[1])
		a := float64(changedAngle)

		radian := angle * math.Pi / 180
		x += m * math.Cos(radian)
		y += m * math.Sin(radian)
		angle -= a
	}
	fmt.Println(int(x))
	fmt.Println(int(y))
}

C++: #include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;

int main() {
	int walk, angle, na = 90;
	double x = 0, y = 0;
	char c;
	
	while(1){
		cin >> walk >> c >> angle;
		if(walk == 0 && angle == 0)break;
		
		double r = double(na / 180.0 * M_PI);
		x += walk * cos(r);
		y += walk * sin(r);
		
		na -= angle;
	}
	
	cout << (int)x << endl;
	cout << (int)y << endl;
	
	return 0;
}

C++: #define _USE_MATH_DEFINES
#include<iostream>
int main()
{
	double x = 0, y = 0;
	int a = 90;
	while (true)
	{
		int di, ai;
		char temp;
		std::cin >> di >> temp >> ai;
		if (di == 0 && ai == 0)
		{
			break;
		}
		x += di * cos(a * M_PI / 180);
		y += di * sin(a * M_PI / 180);
		a -= ai;
	}
	std::cout << static_cast<int>(floor(x)) << std::endl;
	std::cout << static_cast<int>(floor(y)) << std::endl;
	return 0;
}

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

#define PI 3.1415926535

int main(void){
	double x=0.0,y=0.0,d,a,ang=0.0;
	int xint,yint;
	scanf("%lf,%lf",&d,&a);
	while(d!=0.0 || a!=0.0){
		x += d*sin(ang);
		y += d*cos(ang);
		a *= (PI/180);
		ang += a;
		scanf("%lf,%lf",&d,&a);
	}
	xint = x;
	yint = y;
	cout << xint << endl << yint << endl;
	return 0;
}

C++: #include <iostream>

#define M_PI 3.141592653589793

using namespace std;

int debug = 0;

int main(void){
	int len, deg, direction=90;
	double x=0, y=0;
	int i_x, i_y;

	while(cin >> len){
		cin.ignore();
		cin >> deg;

		if(len == 0 && deg == 0) break;

		x += len * cos(direction * M_PI / 180);
		y += len * sin(direction * M_PI / 180);
		
		direction -= deg;
	}

	i_x = x;
	i_y = y;

	cout << i_x << endl;
	cout << i_y << endl;

	return 0;
}

C++: #define _USE_MATH_DEFINES
#include<cmath>
#include<iostream>
int main()
{
	double x = 0, y = 0;
	int a = 90;
	while (true)
	{
		int di, ai;
		char temp;
		std::cin >> di >> temp >> ai;
		if (di == 0 && ai == 0)
		{
			break;
		}
		x += di * cos(a * M_PI / 180);
		y += di * sin(a * M_PI / 180);
		a -= ai;
	}
	const int x_int = static_cast<int>(x >= 0 ? floor(x) : ceil(x));
	const int y_int = static_cast<int>(y >= 0 ? floor(y) : ceil(y));
	std::cout << x_int << std::endl;
	std::cout << y_int << std::endl;
	return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<cmath>
using namespace std;

int main() {
	double x=0, y=0;
	double a, b;
	double c=90;
	while (scanf("%lf,%lf", &a, &b)&&a!=0&&b!=0) {
		x += cos(c*3.14159265/180)*a;
		y += sin(c*3.14159265/180)*a;

		c =90- b;
	}
	x = floor(x);
	y = floor(y);
	cout << x <<' '<< y << endl;

	return 0;
}

C++: #include <iostream>
#include <cmath>
#include <string>
#include <cstdlib>
#define PI 3.141592653589793

using namespace std;

int main() {
  string str;
  int to;
  double x,y,direction,r,theta;
  x = 0;
  y = 0;
  r = 0;
  theta = 0;
  direction = 90;
  while(cin >> str) {
    to = str.find(",",0);
    r = strtol(str.substr(0,to).c_str(),NULL,10);
    theta = strtol(str.substr(to+1).c_str(),NULL,10);
    direction -= theta;
    //cout << direction << endl;
    x += r * cos(direction * PI / 180.0);
    y += r * sin(direction * PI / 180.0);
    str = "0";
  }
  cout << x << endl << y << endl;
}

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

#define PI 3.1415926535898

int main() {
	int rad, adv;
	double x=0.0, y=0.0,dir=0.0;
	while (scanf("%d%*c%d",&adv,&rad)&&adv!=0.0&&rad!=0.0) {
		x += (double)adv*sin(dir*(PI/180.0));
		y += (double)adv*cos(dir*(PI/180.0));
		dir += (double)rad;
	}
	int X = (int)x;
	int Y = (int)y;
	printf("%d\n%d\n",X,Y);
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
 
using namespace std;
 
int main(int argc, char *argv[])
{
  double x,y;
  double sumE = 0;
  double sumN = 0;
  double rad = M_PI/2.0;
  while(scanf("%lf,%lf",&x,&y) !=EOF ){
    getchar();
    if(x ==0&& y== 0)
      break;
    sumE += x*cos(rad);
    sumN += x*sin(rad);
    rad  -= y*M_PI/180;
  }
  cout <<(int)sumE <<endl<<(int)sumN <<endl;
  return 0;
}

C++: #include <iostream>
#include <math.h>
using namespace std;
int main(){
int step,turn;
double x=0,y=0,angle;
while(scanf("%f,%f",&step,&turn),step,turn){
x+=(double)step*sin(angle*M_PI/180);
y+=(double)step*cos(angle*M_PI/180);
angle+=(double)turn;
}
cout << (int)x << endl;
cout << (int)y << endl;
return 0;
}

C++: #ifndef POINT_RADIAN_H
#define POINT_RADIAN_H

#include <iostream>
#include <cmath>

using namespace std;

static const double PI = 3.141592;


class Point{
public:
    double x, y;
    Point(double x=0, double y=0): x(x),y(y){}

    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);}
    Point operator / (double a) {return Point(x/a, y/a);}

};

int main(){
    int d, a;
    int degree(0);
    Point p;
    double radian = 0;
    
    while (scanf("%d,%d",&d, &a)){
        if(d == 0 && a == 0){
            break;
        }
        radian = degree * (PI/180);
        p.x = p.x + d * cos(radian);
        p.y = p.y + d * sin(radian);
        degree += a;

    }
    cout << static_cast<int>(p.y) << "\n";
    cout << static_cast<int>(p.x) << "\n";


}


#endif // POINT_RADIAN_H

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

#define conv 0.0174532925199

using namespace std;

int main()
{
	double x=0.0,y=0.0,m,r,rad=0;
	char a;
	
	for(;;)
	{
		cin >> m >> a >> r ;
		if(m==0 && r==0)
			break;
		x+=m*sin(rad*conv);
		y+=m*cos(rad*conv);
		rad+=r;
	}
	cout << (int)x << endl;
	cout << (int)y << endl;
}

C++: #include <bits/stdc++.h>
int main(){
	int a,b,r=0;double x=0,y=0;
	while(scanf("%d,%d",&a,&b),a||b){
		x+=a*cos(r*M_PI/180.0);
		y+=a*sin(r*M_PI/180.0);
		r+=b;
	}
	printf("%d\n%d\n",(int)y,(int)x);
}

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

#define calc(x) (x*M_PI/180.0)

using namespace std;

int main()
{
  string str;
  int a, b;
  double x=0, y=0, r=0;

  while(scanf("%d,%d",&a,&b) != EOF && !(a == 0 && b == 0)){
    x += (double)a*sin(calc(r));
    y += (double)a*cos(calc(r));
    r += (double)b;
  }
  printf("%d\n%d\n", (int)x, (int)y);

  return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include<math.h>
#define PI (3.14159265)
using namespace std;

int main() {
	double x = 0,y = 0;
	double sdeg = 0;
	double dis,deg;

	while ( scanf( "%lf,%lf", &dis, &deg ), dis + deg ){
		x -= dis * sin( sdeg );
		y += dis * cos( sdeg );
		
		deg = deg * PI / 180.0;
		sdeg -= deg;
	}
	cout << (int)x << endl << (int)y << endl;
	
	return 0;
}

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

static double PI = 3.14159265;

using namespace std;

double dtor(double);

int main() {
    int d, a;
    double f = 90.0, x = 0.0, y = 0.0;

    while(true) {
        scanf("%d,%d", &d, &a);
        if(d == 0 && a == 0) { break; }

        x += d * cos(dtor(f));
        y += d * sin(dtor(f));

        f -= a;
    }
    printf("%d\n%d\n", (int)x, (int)y);
}

double dtor(double deg) {
    return (deg * PI) / 180;
}

C++: #include<iostream>
#include<stdio.h>
#include<math.h>
#define PI 3.141592
using namespace std;

int main(){
    int a, b;
    double x=0, y=0, dig=0;
    while(scanf("%d,%d",&a, &b)){
        if(a==0&&b==0) break;
        x += a*sin(dig*PI/180.0);
        y += a*cos(dig*PI/180.0);
        dig += b;
    }
    cout << (int)x << (int)y << endl;
    return 0;
}