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
Tre = []
num = 0
while True:
    li = list(map(int,input().split(",")))
    if li == [0,0]:
        break
    Tre.append(li)
    num += 1
x,y = 0,0
deg = 90
for i in range(num):
    x,y = x + Tre[i][0]*math.cos(math.pi*deg/180),y + Tre[i][0]*math.sin(math.pi*deg/180)
    deg = deg - Tre[i][1]
print(int(x))
print(int(y))

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

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

def main():
    import math
    LIST=[0,0,math.radians(90)]
    while True:
        a,b=map(float,input().split(","))
        if a==0 and b==0:
            break
        else:
            b=math.radians(b)
            LIST[0]+=a*math.sin(LIST[2])
            LIST[1]+=a*math.cos(LIST[2])
            LIST[2]-=b

    print(int(LIST[1]))
    print(int(LIST[0]))
    
if __name__ == '__main__':
    main()

Python: import math
posx = 0
posy = 0
s = math.radians(90)

while True:
    lst = list(map(int, input().split(",")))
    if lst == [0, 0]:
        break
    
    n = lst[0]
    movex = n* math.cos(s)
    movey = n* math.sin(s)

    posx = posx + movex
    posy = posy + movey

    s = s - math.radians(lst[1])

print(int(posx))
print(int(posy))

Python: import math
x = 0
y = 0
tt = 0
while True:
    d, t = map(float, input().split(','))
    y += d * math.cos(tt / 180 * math.pi)
    x += d * math.sin(tt / 180 * math.pi)
    tt += t
    if d == t ==0:
        break

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]
if x >= 0:
    print(floor(x))
else:
    print(floor(x)+1)
if y >= 0:
    print(floor(y))
else:
    print(floor(y)+1)

Python: from math import radians, sin, cos
import sys
x, y, a = 0, 0, 0
for l in sys.stdin.readlines()[:-1]:
    d, _a = map(int, l.split(","))
    x += d * sin(radians(a))
    y += d * cos(radians(a))
    a += _a

print(int(x), "\n", int(y), sep="")

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

Python: import math
X=0
Y=0
th=0
while 1:
  d,a=list(map(int,input().split(",")))
  if not a and not d:break
  Y+=d*math.cos(math.radians(th))
  X+=d*math.sin(math.radians(th))
  th+=a
print(int(X))
print(int(Y))

Python: from math import radians
from cmath import rect

z = 0
deg = 90
while True:
    r, d = map(float, input().split(','))
    if r == d == 0: break
    z += rect(r, radians(deg))
    deg -= d
print(int(z.real))
print(int(z.imag))

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(ystep))
print("{:.0f}".format(xstep))

Python: from math import radians, cos, sin


if __name__ == '__main__':
    # ??????????????\???
    directions = []
    while True:
        distance, rotation = [int(x) for x in input().strip().split(',')]
        if distance == 0 and rotation == 0:
            break
        else:
            directions.append((distance, rotation))

    # ???????????????
    my_x = 0
    my_y = 0
    my_d = 90
    for d in directions:
        my_x += d[0] * cos(radians(my_d))
        my_y += d[0] * sin(radians(my_d))
        my_d -= d[1]

    # ???????????????
    print('{0}\n{1}'.format(int(my_x), int(my_y)))

Python: import math
x = y = 0
h = math.radians(90)
while True:
    d, t = map(int, input().split(","))
    if d == t == 0:
        break
    x += d * math.cos(h)
    y += d * math.sin(h)
    h -= math.radians(t)
print("{} {}".format(int(math.modf(x)[1]), int(math.modf(y)[1])))

Python: import sys
f = sys.stdin
import math, cmath

direction = 1j
location = 0 + 0j
while True:
    step, degrees = map(int, f.readline().split(','))
    location += direction * step
    direction *= cmath.rect(1, math.radians(-degrees))
    if step == 0:
        break
print(int(location.real))
print(int(location.imag))

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: 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),'\n',int(z.imag),sep='')

Python: import math
x = 0.0;
y = 0.0;
a = 90.0;
while True :
    distance, angle = map(float, input().split(","))
    if distance == 0 and angle == 0: break

    radangle = math.radians(a)

    x += math.cos(radangle) * distance
    y += math.sin(radangle) * distance
    a -= angle

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

Python: '''
Created on Mar 22, 2013

@author: wukc
'''
from sys import stdin
import math

x,y=0,0
t=math.radians(90)
for l in stdin:
    r,d=map(int,l.split(","))
    if (r,d)==(0,0): break
    x+=r*math.cos(t)
    y+=r*math.sin(t)
    t+=math.radians(-d)    
    
print(int(x))
print(int(y))

Python: import math

x, y = 0.0, 0.0
theta = 0.0
while True:
	d, t = [eval(num) for num in input().split(',')]
	if d == 0 and t == 0:
		break
	x += d * math.sin(theta)
	y += d * math.cos(theta)
	theta += t * math.pi / 180.0
print(int(x))
print(int(y))

Python: from math import cos, sin, pi

treasure_x, treasure_y = 0, 0
angle = 90

while True:
    d, a = map(int, input().split(','))

    if d == 0 and a == 0:
        break

    radian_a = a * 2 * pi / 180

    treasure_x += d * cos(radian_a)
    treasure_y += d * sin(radian_a)

print(int(treasure_x))
print(int(treasure_y))

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: from math import *

x = 0
y = 0
D = []
A = []
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(A[i] * pi / 180)
    y = y - D[i] * sin(A[i] * pi / 180)
print(floor(x))
print(floor(y))

Python: # coding=utf-8
import math

x = 0
y = 0
direction = math.pi/2
while True:
    d, a = map(int, input().split(','))
    if d == 0 and a == 0:
        break
    x += d * math.cos(direction)
    y += d * math.sin(direction)
    direction -= a*math.pi/180
print('{0:.0f}'.format(math.modf(x)[1]))
print('{0:.0f}'.format(math.modf(y)[1]))

Python: from math import *

x = 0
y = 0
D = []
A = []
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(A[i] * pi / 180)
    y = y + D[i] * sin(A[i] * pi / 180)
print(x,y)