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))
}

Python: import math

x = y = 0
# 初めは90から
totalAngle = 90
while(1):
    try:
        num,angle = (int(x) for x in input().split(","))
        if num == 0:break
        rad = math.radians(totalAngle)
        y += math.sin(rad) * num
        x += math.cos(rad) * num
        # 右周り+だから-になる
        totalAngle -= angle
    except EOFError:
        break
print(int(x))
print(int(y))

Python: from math import pi,sin,cos
_x=_y=a=0
while 1:
    x,y=map(int,input().split(','))
    if x==y==0:break
    r=a*pi/180
    _x+=x*sin(r)
    _y+=x*cos(r)
    a+=y
print(*map(int,[_x,_y]),sep='\n')

Python: import cmath
import math

z = 0 + 0j
theta = 90
while True:
    r, phi = map(int, input().split(","))
    if r == phi == 0:
        break
    z += cmath.rect(r, math.radians(theta))
    theta = (theta - phi) % 360
print(math.trunc(z.real))
print(math.trunc(z.imag))

Python: # -*- coding:utf-8 -*-
import math

def walk(d,angle):
    x = d*math.cos(angle)
    y = d*math.sin(angle)
    p = [x,y]
    return p

x,y,angle = 0,0,90
while True:
    d, a = map(int, input().split(","))
    p = walk(d,math.radians(angle))
    x += p[0]
    y += p[1]
    angle -= a
    if d == a == 0:
        break

print(int(x))
print(int(y))

Python: from math import *
x = 0
y = 0
a = 0

while True:
    l, r = [int(i) for i in input().split(",")]
    if l == 0 and r == 0:
        break
    
    x += l * sin(radians(a))
    y += l * cos(radians(a))
    
    a = (a+r)%360

print(int(x))
print(int(y))

Python: import sys
import math

def TreasureHunt():
    x,y=(0.0,0.0)
    alpha=90
    
    for line in sys.stdin:
        a,b=list(map(int,line.split(',')))
        if a==0 and b==0:
            break
        
        x+=a*math.cos(alpha/180.0*math.pi)
        y+=a*math.sin(alpha/180.0*math.pi)
        alpha=(alpha-b+360)%360

    print(int(x),int(y))

        
        
            
TreasureHunt()

Python: import math
x = y = 0
ang = 90
while True:
    d, a = map(int, input().split(','))
    if d == a == 0:
        break
    rad = ang * math.pi / 180
    x += d * math.cos(rad)
    y += d * math.sin(rad)
    ang -= a
print(int(x))
print(int(y))

Python: #!/usr/bin/env python
#-*- coding:utf-8 -*-

import sys
import math

gx = 0
gy = 0
th = 90

for s in sys.stdin:
    x, rot = map(int, s.split(','))
    gx += x * math.cos(th/180*math.pi)
    gy += x * math.sin(th/180*math.pi)
    th -= rot

print(int(gx))
print(int(gy))

Python: import math
x=0
y=0
angle=0
while True:
    r,c=map(int, input().split(","))
    if r == c == 0:
        break

    x += r*math.cos(-angle)
    y += r*math.sin(-angle)
    angle += c

print(x)
print(y)

Python: # Treasure Hunt
import math
x,y,pd = 0,0,-90
r,d = map(int, input().split(','))
while not (r == 0 and d == 0):
    x += r * math.cos(math.radians(-pd))
    y += r * math.sin(math.radians(-pd))
    pd += d
    r,d = map(int, input().split(','))
print(int(x))
print(int(y))

Python: import math
x = 0
y = 0
shi = 90
while 1:
    a,b = map(int, input().split(","))
    if a == 0 and b == 0:
        break
    else:
        x += a*math.cos(math.radians(shi))
        y += a*math.sin(math.radians(shi))
        shi -= b
print(int(x))
print(int(y))

Python: import sys
import itertools
import math

curdeg = 90
xstep = 0
ystep = 0
for line in sys.stdin.readlines():
    step, deg = map(int, line.split(","))
    xstep += -step * math.cos(math.pi * curdeg / 180)
    ystep += step * math.sin(math.pi * curdeg / 180)
    curdeg += deg 

print("{:.0f}".format(xstep))
print("{:.0f}".format(ystep))

Python: import math

A = 90
North = 0
East = 0
while True:
    d, a = map(int, input().split(','))
    if d==0 and a==0:
        break
    North += d * math.sin(math.radians(A))
    East += d * math.cos(math.radians(A))
    A -= a

print(int(East))
print(int(North))

Python: import math

x, y = 0, 0
angle = 90

while True:
  line = map(int, raw_input().split(','))
  if line[0] == 0 and line[1] == 0: break
  radian = math.radians(angle)
  x += math.cos(radian) * line[0]
  y += math.sin(radian) * line[0]
  angle -= line[1]

print(int(x))
print(int(y))

Python: from math import sin, cos, radians

cl = [0, 0]
cd = 0

while True:
    o = input()
    if o == (0, 0):
        break

    cl[0] += o[0] * sin(radians(cd))
    cl[1] += o[0] * cos(radians(cd))
    cd += o[1]
    if 180 <= cd:
        cd -= 360
    elif cd <= -180:
        cd += 360

for x in cl:
    print(int(x))

Python: import cmath,math,sys
z=0;p=90
for e in sys.stdin:
 r,d=map(int,e.split(','))
 z+=cmath.rect(r,math.radians(p))
 p-=d
print(int(z.real))
print(int(z.imag))

Python: import math
x, y, now = 0, 0, 90
while 1:
    d, a = map(float, input().split(','))
    if d == 0 and a == 0:
        break
    x += d*math.cos(now * math.pi / 180)
    y += d*math.sin(now * math.pi / 180)
    now -= a

print(int(x))
print(int(y))

Python: import sys
import itertools
import math

curdeg = 0
xstep = 0
ystep = 0
for line in sys.stdin.readlines():
    step, deg = map(int, line.split(","))
    xstep += step * math.cos(math.pi * curdeg / 180)
    ystep += step * math.sin(math.pi * curdeg / 180)
    curdeg += deg 

print("{:.0f}".format(xstep))
print("{:.0f}".format(ystep))

Python: import math, cmath

D = 90
p = complex(0, 0)
while True:
    r, d = map(float, input().split(','))
    if r == d == 0:
        print(int(p.real))
        print(int(p.imag))
        exit()

    p += cmath.rect(r, math.radians(D))
    D -= d

Python: import math
x = y = 0
angle = 90
while True:
    d, a = map(int, input().split(','))
    if d == a == 0:
        break
    x += d * math.cos(math.radians(angle))
    y += d * math.sin(math.radians(angle))
    angle -= a
print(int(x))
print(int(y))

Python: from math import *

x = 0
y = 0
D = []
A = []
sum_a = -90
while True:
    d, a = map(int, input().split(","))
    if a == 0 and d == 0:
        break
    else:
        D.append(d)
        A.append(a)
for i in range(len(A)):
    x = x + D[i] * cos(sum_a * pi / 180)
    y = y - D[i] * sin(sum_a * pi / 180)
    if abs(x-round(x))<10**(-7):
        x=round(x)
    if abs(y - round(y)) < 10 ** (-7):
        y=round(y)
    sum_a += A[i]
print(floor(x))
print(floor(y))

Python: import math
deg = 90
x = 0.0
y = 0.0
while True:
    di,ai = map(int, input().split(','))
    if di==0 and ai==0:
        break
    x += di*math.cos(deg*math.pi/180.0)
    y += di*math.sin(deg*math.pi/180.0)
    deg -= ai

print("%d\n%d" % (x,y))

Python: import math
x = 0
y = 0
degree = 0
while(True):
    a = map(int, raw_input().split(","))
    if(a[0] == 0 and a[1] == 0):
        break
    x += a[0] * math.sin(math.radians(degree))
    y += a[0] * math.cos(math.radians(degree))
    degree += a[1]
print(int(x))
print(int(y))

Python: import math
X = Y = a = 0
while True:
    x,y = map(int,input().split(','))
    if x == y == 0:
        break
    r = a * math.pi / 180
    X += x*math.sin(r)
    Y += x*math.cos(r)
    a+=y
print(*map(int,(X,Y)),sep='\n')

Python: import math
x,y,r = 0,0,90
while True:
  m,n = map(int,raw_input().split(','))
  if (m,n) == (0,0):
    break
  y += m * math.sin(math.radians(r))
  y
  x+= m * math.cos(math.radians(r))
  r -= n
print(int(x))
print(int(y))