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

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

import sys
import os
from math import sin, cos
import math

def rotate_vector(v, rad):
    x = v[0]
    y = v[1]

    new_x = cos(rad) * x - sin(rad) * y
    new_y = sin(rad) * x + cos(rad) * y
    return (new_x, new_y)

pos = [0, 0]
dir = [0, 1]
for s in sys.stdin:
    length, degree = map(int, s.split(','))

    # move
    pos[0] += dir[0] * length
    pos[1] += dir[1] * length

    # rotate
    rad = math.radians(degree)
    rad *= -1

    # rotated dir
    dir = rotate_vector(dir, rad)
print(int(pos[0]))
print(int(pos[1]))

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(x))
print('{0:.0f}'.format(y))

Python: #! /usr/bin/python

import math

def main():

	turtle = Turtle(0, 0, 0, 1)
	while True:
		input = raw_input()
		if input == '0,0':
			break

		args = input.strip().split(',')
		dist = int(args[0])
		degree = int(args[1])

		rad = 2 * math.pi * degree / 360.0

		turtle.move(dist)
		turtle.rotate(rad)

	print("%d" % (turtle.x))
	print("%d" % (turtle.y))

class Turtle:

	def __init__(self, x, y, vx, vy):
		self.x  = x
		self.y  = y
		self.vx = vx
		self.vy = vy
		self.normalize_velocity()

	def move(self, dist):
		self.x += self.vx * dist
		self.y += self.vy * dist

	def normalize_velocity(self):
		vx = self.vx
		vy = self.vy
		v = math.sqrt(vx * vx + vy * vy)
		self.vx = vx / v
		self.vy = vy / v

	def rotate(self, theta):
		vx = self.vx
		vy = self.vy

		self.vx = vx * math.cos(theta) + vy * math.sin(theta)
		self.vy = -vx * math.sin(theta) + vy * math.cos(theta)


main()

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(int(x))
print(int(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\n" % (x,y))

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

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


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))
    print(int(y))

        
        
            
TreasureHunt()

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

Python: import math

def get_input():
    while True:
        try:
            yield ''.join(input())
        except EOFError:
            break

N = list(get_input())
x,y = 0,0
arg = 90
for l in range(len(N)):
    d,a = [int(i) for i in N[l].split(",")]
    if d == 0 and a == 0:
        break
    x = x + d * math.cos(math.radians(arg))
    y = y + d * math.sin(math.radians(arg))
    arg = arg - a
print(math.trunc(x))
print(math.trunc(y))

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)
print(y)

Python: import math

if __name__ == '__main__':
    x = 0
    y = 0
    angle = 90

    r, t = map(int, input().split(','))

    while r != 0 or t != 0:
        x = x + r * math.cos(math.radians(angle))
        y = y + r * math.sin(math.radians(angle))
        angle -= t
        r, t = map(int, input().split(','))
    print(int(x))
    print(int(y))

Python: import math

def calc(x, y, r, d, nd):
	x = x + r * math.cos(math.radians(d))
	y = y + r * math.sin(math.radians(d))
	d -= nd
	return x, y, d

x = y = 0
d = 90

while True:
	r, nd = map(int, input().split(","))
	if r == nd == 0: break
	x, y, d = calc(x, y, r, d, nd)

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

Python: import math

res_x, res_y = 0, 0
r = 90
while 1:
    x, y = list(map(int, input().split(',')))
    if x == 0 and y == 0:
        break
    r2 = math.radians(r)
    res_x += x * math.cos(r2)
    res_y += x * math.sin(r2)
    r = r - y

print(int(res_x))
print(int(res_y))

Python: import math
x = 0
y = 0
r = 90
while True:
    d,t=map(int, input().split(','))
    if d==0 and t==0:
        print(int(x),int(y),sep='\n')
        exit()
    x += math.cos(math.radians(r)) * d
    y += math.sin(math.radians(r)) * d
    r -= t

Python: import math

def move(dig):
    rad = math.radians(dig)
    x = math.cos(rad)
    y = math.sin(rad)
    return x,y

def run():
    x, y = 0,0
    dig = 90
    while True:
        r, d = map(int, input().split(','))
        d = -d
        if r == 0 and d == 0:
            break
        _x, _y = move(dig)
        dig += d
        x += r * _x
        y += r * _y

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

if __name__ == '__main__':
    run()

Python: import sys
import math
N=[]
for l in sys.stdin:
  a=list(map(int,l.split(",")))
  N.append(a)
  
x=0
y=0
n=90

for d in N:
  if d[0]==0 and d[1]==0:
    break
  x=x+d[0]*math.cos(math.radians(n))
  y=y+d[0]*math.sin(math.radians(n))
  #print(x,y)
  n-=d[1]

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

Python: from math import radians, cos, sin, ceil, floor
g = 90
x = y = 0
while 1:
    d, a = map(int, input().split(","))
    if d == 0:
        break
    t = radians(g)
    x += cos(t) * d
    y += sin(t) * d
    g -= a
x = floor(x) if x > 0 else ceil(x)
y = floor(y) if y > 0 else ceil(y)
print("%d" % x)
print("%d" % y)

Python: import sys
import math as mas

x,y,d=0,0,90
for t in sys.stdin:
	a,b=map(int,t.split(','))
	if a==b==0:break
	x+=a*mas.cos(mas.radians(d))
	y+=a*mas.sin(mas.radians(d))
	d-=b
print(x)
print(y)
#for i in sys.stdin:
#	a,b=map(int,i.split())
#	print(gcd(a,b),lcm(a,b))

Python: from math import sin,cos,pi
x = 0
y = 0
ca = 90
while True:
    d, a = list(map(int, input().split(",")))
    if d or a:
        x += d*cos(ca*pi/180)
        y += d*sin(ca*pi/180)
        ca -= a
    else:
        break

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

Python: import math as m
x,y,d=0,0,90
while True:
    r,t=map(int,input().split(","))
    if (r,t)==(0,0):
        break
    x+=r*m.cos(m.radians(d))
    y+=r*m.sin(m.radians(d))
    d-=t
print(int(m.sqrt(x**2+y**2)))
print(d)

Python: from math import radians
from cmath import rect

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