Go: package main

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

func main() {
	var a, b float64
	var x, y float64
	x = 0
	y = 0
	var now float64
	now = 90
	var info string
	for {
		fmt.Scan(&info)
		infos := strings.Split(info, ",")
		a_int, _ := strconv.Atoi(infos[0])
		b_int, _ := strconv.Atoi(infos[1])
		a = float64(a_int)
		b = float64(b_int)
		// println(a, b)
		if a == 0 && b == 0 {
			break
		}
		x += math.Cos(now*math.Pi/180)*a
		y += math.Sin(now*math.Pi/180)*a
		now -= b
	}
	fmt.Printf("%d\n%d\n", int(x), int(y))
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cstdio>
#include<cmath>
#define PI acos(-1)
using namespace std;
int main(){
double x=0,y=0,ka=PI/2;
int ho,kai;
char d;
while(cin>>ho>>d>>kai,ho||kai){
x+=ho*cos(ka);
y+=ho*sin(ka);
ka-=PI/180*kai;
}
//cout<<(double)sin(0)<<endl;
cout<<(int)x<<endl<<(int)y<<endl;
}

C++: #include<bits/stdc++.h>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<algorithm>
using namespace std;


int main(){
    int a,b,theta=90;
    double x=0,y=0,pi=3.141592653589;
    char k;
    for(;;){
        scanf("%d,%d",&a,&b);
        if(a==0 && b==0){
            break;
        }
        y+=a*sin(theta/180.0*pi);
        x+=a*cos(theta/180.0*pi);
        theta+=b;
    }
    printf("%d\n%d\n",(int)-x,(int)y);
    return 0;
}

C++: #include <iostream>
#include <math.h>
using namespace std;

int main(){
  int l,theta_in,theta = 90;
  double x = 0, y = 0;
  char k;
  double pi = atan(1)*4;
  while(cin >> l >> k >> theta_in,l||theta_in){
	x += l*cos(theta*pi/180); 
	y += l*sin(theta*pi/180);
	theta -= theta_in;
  }
  cout << (int) x << endl
	   << (int) y << endl;
  return 0;
}

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

int main(void)
{
    int d, t;
    char c;
    double x = 0.0, y = 0.0, r = 0.0;
    while(cin >> d >> c >> t) {
        if (d == 0 && t == 0)
            break;
        y += d * cos(r / 180 * M_PI);
        x += d * sin(r / 180 * M_PI);
        r += t;
    }

    cout << (int)x << endl;
    cout << (int)y << endl;
    return 0;
}

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

constexpr auto PI = 3.14159265358979323846264338;

auto main () -> int
{
    int d , t;
    double x = 0 , y = 0;
    int angle = 0;
    while (std::scanf ("%d,%d" , & d , & t) == 2 && (d || t))
    {
        x += d * std::sin (angle * PI / 180.0);
        y += d * std::cos (angle * PI / 180.0);
        angle += t;
    }
    std::cout << static_cast <int> (x) << std::endl;
    std::cout << static_cast <int> (y) << std::endl;
}

C++: /*****include*****/
#include <iostream>
#include <fstream>
#include <math.h>

/*****デバッグ定義*****/
//#define DEBUG
#define PI 3.14
/*****マクロ定義*****/

/*****名前空間*****/
using namespace std;

/*****グローバル変数置き場*****/

/*****その他関数置き場*****/

/*****main関数*****/
int main(){
	/*****ファイルオープン*****/
#ifdef DEBUG
	ofstream fout("output.txt");
	ifstream fin("input.txt");
	if(!fout || !fin){
		cout << "Can't open the file.\n";
		return;
	}
#endif
	/*****変数置き場*****/
	int walk=0,degree=0,last_degree;
	double x_ax,y_ax;
	/*****処理部*****/
	last_degree = 90;
	x_ax = 0;
	y_ax = 0;
	while(1){
		scanf("%d,%d",&walk,&degree);
		if(walk == 0 && degree == 0)	break;
		//printf("%d\n%d\n",walk,degree);
		x_ax += (double)walk * cos((double)last_degree * PI / 180);
		y_ax += (double)walk * sin((double)last_degree * PI / 180);
		last_degree = last_degree - degree;
	}
	printf("%d\n%d\n",(int)x_ax,(int)y_ax);
	/*****処理終了後*****/
#ifdef DEBUG
	fout.close();
	fin.close();
#endif
	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 * sin(radian);
        p.y = p.y + d * cos(radian);
        degree += a;

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


}


#endif // POINT_RADIAN_H

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

#define PI 3.14159265358979323

int main(void)
{
  double deg = 30;
  double ang = 90;
  double len = 2;
  double ansx = 0, ansy = 0;
  while (1) {
    scanf("%lf,%lf", &len, &deg);
	if (len == 0 && deg == 0)
		break;
    double rad = ang * PI / 180.0;
    double x = len * cos( rad );
    double y = len * sin( rad );
	ang = ang - deg;
//    printf( "X=%f Y=%f\n", x, y );
	ansx = ansx + x;
	ansy = ansy + y;
  }
  printf( "%.0f\n%.0f\n", floor(ansx), ansy );

  return 0;
}

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


int main()
{
	int x = 0, y = 0;
	double d = 0, a = 90, r;
	while (d != 0 || r != 0) {
		cin >> d >> r;
		x = x + d * cos(a / 2 / pi);
		y = y + d * sin(a / 2 / pi);
		a = a + r;
	}
	cout << x << endl << y << endl;
    return 0;
}

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

#define Pai 3.141592653589793
int main(void)
{
	double x=0,y=0,l=90,n,m;
	
	while(1){
		scanf("%lf,%lf",&n,&m);
		if (n==0&&m==0) {
			break;
		}
		y+=n*sin((double)l*Pai/180);
		x+=n*cos((double)l*Pai/180);
		l-=m;
	}
	printf("%.0f\n%.0f\n",x,y);
	
	return (0);
}

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

void sepTwoNumbers(char*, int&, int&);
int char2Number(const char*, int, int);

bool inputNumber(char*);

int main(){
	double const PI = 3.141592653589793;
	double point[2] = { 0, 0 };
	int angle = 90;
	int d, a;
	char inputNumbers[10];
	while (inputNumber(inputNumbers)){
		sepTwoNumbers(inputNumbers, d, a);
		
		point[0] += d * std::cos(PI * angle / 180);
		point[1] += d * std::sin(PI * angle / 180);
		angle -= a;
	}
	std::cout << static_cast<int>(point[0]) << std::endl;
	std::cout << static_cast<int>(point[1]) << std::endl;
	return 0;
}

//入力文字から2つの文字を分離させる関数
void sepTwoNumbers(char* charOftwoNumber, int& number1, int& number2){
	int commaIndex;
	int endIndex;

	for (commaIndex = 0; charOftwoNumber[commaIndex] != ','; ++commaIndex);

	number1 = char2Number(charOftwoNumber, 0, commaIndex);

	for (endIndex = commaIndex; charOftwoNumber[endIndex] != '\0'; ++endIndex);

	number2 = char2Number(charOftwoNumber, commaIndex + 1, endIndex);
}

//文字列を数字に変換する関数
int char2Number(const char* charNumber, int startDigit, int endDigit){
	int number = 0;
	int sd = 1;
	if (charNumber[startDigit] == '-'){
		sd = -1;
		++startDigit;
	}
	for (int i = startDigit; i < endDigit; ++i){
		number *= 10;
		number += charNumber[i] - '0';
	}
	return number * sd;
}

bool inputNumber(char* inputNumbers){
	std::cin >> inputNumbers;
	if (inputNumbers[0] == '0' && inputNumbers[2] == '0'){
		return false;
	}
	else{
		return true;
	}
}