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>

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!=0||t!=0))			//霎灘?0,0扈捺據
	{
		x -= d * sin((dir) * PI / 180.0);						//隶。邂?		y += d * cos((dir) * PI / 180.0);
	    dir -= t;
	}
	printf("%d\n%d\n", (int)x, (int)y);					//霎灘?

	return 0;
}

C++: #include <iostream>
#include <cmath>
#define PI 3.14159265
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 += len * cos(shita * PI / 180);
    y += len * sin(shita * PI / 180);
    shita += rot;
  }
  cout << x <<  endl;
  cout << y << endl;
  return 0;
}

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

int main(){
  int d, a = 90, a2; 
  double x,y;
  char c;
  while(cin >> d >> c >> a2){
    if(d == 0 && a == 0) break;
    double rad = a * (PI / 180);
    x += d * cos(rad);
    y += d * sin(rad);
    a += a2;
    }
  }
  cout << (int)x << "\n" << (int)y << endl;
}

C++: #include <cstdio>
#include <cmath>
using namespace std;
#define PI 3.141592653

double to_radian(int angle) {
  return double(angle) * PI / 180.0;
}

int main() {
  int len,angle;
  double x,y,rad;
  x = y = 0.0;
  rad = to_radian(90);
  while(scanf("%d,%d",&len,&angle)) {
    if((len | angle) == 0) break;
    x += len * cos(rad);
    y += len * sin(rad);
    rad = rad - to_radian(angle);
  }
  printf("%d\n%d\n",int(x),int(y));
}

C++: #include<iostream>
#include<math.h>
#include<stdio.h>
#define M_PI 3.14159265358979 /* 円周率 */

using namespace std;

int main(){
	int len, deg;
	int deg_now = 90;
	double x = 0, y = 0;

	while (1){
		scanf("%d,%d", &len, &deg);
		if (len == 0 && deg == 0) break;
		x += len*cos(deg_now / 180.0 * M_PI);
		y += len*sin(deg_now / 180.0 * M_PI);
		deg_now += deg;
	}

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

	return 0;

}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
#include<iterator>
using namespace std;
typedef  long long int lint;
typedef pair<int, int> IP;
typedef pair<lint, lint> LLP;
typedef pair<char, char>CP;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define llower(v,hoge) *lower_bound(v.begin(), v.end(), hoge)
#define lupper(v,hoge) *upper_bound(v.begin(), v.end(), hoge)

int stringTOlint(string s) {
	//string→lint
	lint Z = s.size();
	lint ret = 0;
	reverse(s);
	rep(i, Z) {
		ret += ((s[i] - '0') * pow(10, i));
	}
	return ret;
}

int main() {
	double pi = 3.1415926535;
	string S;
	int LD=0, LA=0;
	double D=0, A=0;
	double NX = 0, NY = 0, NA = 90;
	while (1) {
		cin >> S;
		if (S == "0,0") {
			cout << int(NX)*(-1) << endl << int(NY) << endl;
			return 0;
		}
		else {
			string SD, SA;
			bool flag = false;
			rep(i, S.size()) {
				if (S[i] == ',') {
					flag = true;
				}
				else {
					if (flag == false) {
						SD.push_back(S[i]);
					}
					else {
						SA.push_back(S[i]);
					}
				}
			}
			LD = stoi(SD);
			LA = stoi(SA);
			D = double(LD);
			A = double(LA);
			NX += D * cos(NA * pi / 180);
			NY += D * sin(NA * pi / 180);
			NA += A;
		}
	}
}

C++: #include <iostream>
#include <cstdio>
#include <complex>
#define _USE_MATH_DEFFINES
#include <cmath>
using namespace std;
typedef complex<double> P;

double convert(double angle) {
    return((M_PI * (angle / 180.0)));
}

P now(0, 0);
double angle = 0;

int main(void) {
    int fd, spin;
    
    while(scanf("%d,%d", &fd, &spin), fd + spin != 0) {
        double nextx = now.real() + fd * cos(convert(angle)),
        nexty = now.imag() + fd * sin(convert(angle));
        now = P(nextx, nexty);
        angle += spin;
    }
    cout << (int)now.real() << endl << (int)now.imag() << endl;
    return(0);
}

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

double PI = 3.141592653589793238;

int main() {
	double x = 0.0, y = 0.0, dir = PI / 2;
	while (true) {
		int d, a;
		std::scanf("%d,%d", &d, &a);
		if (d == 0 && a == 0) break;
		x += std::cos(dir) * d;
		y += std::sin(dir) * d;
		dir -= a * PI / 180;
	}
	int ix = x, iy = y;
	std::cout << ix << std::endl << iy << std::endl;
	return 0;
}

C++: #include <cstdio>
#include <cstring>
#include <cmath>
#include <vector>
#include <map>
#include <algorithm>

#define rep(i, j) FOR(i, 0, j)
#define FOR(i, j, k) for(int i = j; i < k; ++i)

using namespace std;

int main(){
  double d, t, x, y, n;
  x = y  = 0;
  n = 90;
  while(scanf("%lf,%lf", &d, &t) && d && t){
    x += d * sin(n * M_PI / 180);
    y += d * cos(n * M_PI / 180);
    n -= t;

  }
  printf("%d\n%d\n", (int)y, (int)x);
  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);
		h+=x*cos(r*M_PI/180);
		r-=y;
	}
	printf("%.0f\n%.0f\n",h,k);
	return 0;
}

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

double diffx(int d,int r){
  return d*cos(-1*(r*PI/180.0-PI/2));
}

double diffy(int d,int r){
  return d*sin(-1*(r*PI/180.0-PI/2));
}

int main(){
  double x=0,y=0;
  int r=0;
  int move,rr;
  while(true){
    scanf("%d,%d",&move,&rr);
    if(move==0){
      cout<<(int)x<<endl<<(int)y<<endl;  
      return 0;
    }
    x+=diffx(move,r);
    y+=diffy(move,r);
    //  cout<<diffx(move,r)<<' '<<diffy(move,r)<<endl;
    r+=rr;
    // cout<<'('<<x<<','<<y<<')'<<endl;  
  } 

}

C++: #include<iostream>
#include<sstream>
#include<fstream>
#include<cstdio>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<deque>
#include<map>
#include<set>
#include<string>
#include<cmath>
#include<algorithm>
#include<cstdlib>
using namespace std;

int main(){
	double tot = 0,alfa = 90,x=0,y=0;
	int m,t;
	while(scanf("%d,%d",&m,&t),m || t){
		//alfa += t;
		x += m*cos(alfa*3.1416/180.0);
		y += m*sin(alfa*3.1416/180.0);
		alfa -= t;
	}
	x = (int)x;
	y = (int)y;
	cout<<x<<endl;
	cout<<y<<endl;
	return 0;
}

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

using namespace std;

int main()
{
    double v;

    while (scanf("%lf", &v) != EOF) {
        double ans = (v*v/98);
        if (ans - (int)ans < 0.00000000001) {
            printf("%d\n", (int)ans + 1);
        } else {
            printf("%d\n", (int)ans + 2);
        }

    }

    return 0;
}