Problem:


レシート 

問題

太郎君は10冊の本を購入した．
後日，
レシートをもとに価格を調べようとしたが，
レシートには汚れがあり，
ある本の価格が読み取れなかった．
その本の価格を， 
10冊の総額と他の9冊の価格から計算することにした．

価格が読み取れなかった本の価格を出力するプログラムを書け．
なお，本の価格はすべて正の整数である．
また，消費税を考慮する必要はない．

 入力

入力は複数のデータセットからなる．各データセットは以下の形式で与えられる．

各データセットは10行からなり，1行に1つずつ正の整数が書かれている．
1行目の整数は10冊の総額を，
2行目から10行目の整数は読み取れた価格を表している．
なお，10冊の総額は10000以下である．

総額 が 0 のとき入力の終了を示す.データセットの数は 5 を超えない．

 出力

データセットごとに，価格が読み取れなかった本の価格を1 行に出力する．

 入出力例

入力例

9850
1050
800
420
380
600
820
2400
1800
980
0

出力例

600

上記問題文と自動審判に使われるデータは、情報オリンピック日本委員会が作成し公開している問題文と採点用テストデータです。



Sample input:
9850
1050
800
420
380
600
820
2400
1800
980
0


Sample output:
600

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[]
for i in range(9):
	tmp=int(input())
	l.append(tmp)
	ans=0
for i in range(9):
	ans+=l[i]
	print(n-ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[]
for i in range(9):
	tmp=int(input())
	l.append(tmp)
	ans=0
for i in range(9):
	ans+=l[i]
print(n-ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[]
for i in range(9):
	tmp=int(input())
	l.append(tmp)
	ans=0
for i in range(9):
	ans+=l[i]
	a=n-ans
print(a)

Submission status: Wrong Answer

Solution code:
n=int(input())
l=[]
for i in range(9):
	tmp=int(input())
	l.append(tmp)
ans=0
for i in range(9):
	ans+=l[i]
	a=n-ans
print(a)

Submission status: Wrong Answer

Solution code:
N=int(input())
l=[]
for i in range(9):
	tmp=int(input())
	l.append(tmp)
ans=0
for i in range(9):
	ans+=l[i]
	a=N-ans
print(a)

Submission status: Wrong Answer

Solution code:
su = int(input())
for i in range(9):
    n = int(input())
    su -= n
print(su)

Submission status: Wrong Answer

Solution code:
al = int(input())
for i in range(0,9):
  a = int(input())
  al -= a
print al

Submission status: Wrong Answer

Solution code:
s = input()
for i in range(9):
  s -= input()
print s

Submission status: Wrong Answer

Solution code:
while True:
  s = input()
  if not s:
    break
  for i in range(9):
    s -= input()
    print s

Submission status: Wrong Answer

Solution code:
sums = int(raw_input())
for i in range(9):
    sums -= int(raw_input())
print sums

Submission status: Accepted

Solution code:
while(1):
	N=int(input())
	if(N==0):
 	  exit()
	l=[]
	for i in range(9):
		tmp=int(input())
		l.append(tmp)
	ans=0
	for i in range(9):
		ans+=l[i]
		a=N-ans
	print(a)

Submission status: Accepted

Solution code:
while 1:
    s = input()
    if s == 0: break
    for i in range(9): s -= input()
    print s

Submission status: Accepted

Solution code:
while 1:
    s = input()
    if s == 0: break
    print s - sum(input() for i in range(9))

Submission status: Accepted

Solution code:
while True:
    su = int(input())
    if su == 0:
        break
    for i in range(9):
        n = int(input())
        su -= n
    print(su)

Submission status: Accepted

Solution code:
while 1:
    n=int(input())
    if n==0:break
    print(n-sum([int(input()) for _ in range(9)]))

Submission status: Accepted

Solution code:
while True:
    total = int(input())
    if total == 0:
        break
    prices = [int(input()) for _ in range(9)]
    print(total - sum(prices))

Submission status: Accepted

Solution code:
while True:
    s = int(input())
    if s == 0: break
    for _ in range(9):
        s -= int(input())
    print(s)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0543

"""
import sys
from sys import stdin
input = stdin.readline


def main(args):
    while True:
        total = int(input())
        if total == 0:
            break
        books = [int(input()) for _ in range(9)]
        print(total - sum(books))


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
while True:
    p_sum=int(input())
    if p_sum==0:break
    price=[int(input())for i in range(9)]
    for p in price:
        p_sum-=p
    print(p_sum)

Submission status: Accepted

Solution code:
while True:
    s = int(input())
    if (s == 0):
        break

    price = [int(input()) for i in range(9)]
    print(s - sum(price))

Submission status: Accepted

Solution code:
for e in iter(input,'0'):
 print(int(e)-sum(int(input())for _ in[0]*9))

Submission status: Accepted

Solution code:
while True:
  n = int(input())
  if not n: break
  print(n - sum([int(input()) for _ in range(9)]))

Submission status: Accepted

Solution code:
# AOJ 0543: Receipt
# Python3 2018.7.1 bal4u

import sys
from sys import stdin
input = stdin.readline

while True:
	s = int(input())
	if s == 0: break
	print(s-sum([int(input()) for i in range(9)]))

Submission status: Accepted

Solution code:
while True:
  al = int(input())
  if al == 0: break
  for i in range(0,9):
    a = int(input())
    al -= a
  print al

Submission status: Accepted

Solution code:
while True:
    n=input()
    if n==0:break
    print n-sum(input() for i in range(9))

Submission status: Accepted

Solution code:
while True:
	total = input()
	if total == 0: break
	s = sum([input() for i in range(9)])
	print total - s

Submission status: Accepted

Solution code:
while True:
	s = int(raw_input())
	if s == 0:
		exit()
	print s - sum([int(raw_input()) for i in xrange(9)])

Submission status: Accepted

Solution code:
while True:
  s = input()
  if not s:
    break
  for i in range(9):
    s -= input()
  print s

Submission status: Accepted

Solution code:
while 1:
    s = input()
    if s==0: break
    for i in xrange(9):
        s -= input()
    print s

Submission status: Accepted

Solution code:
while 1:
    sums = int(raw_input())
    if not sums:
        break
    for i in range(9):
        sums -= int(raw_input())
    print sums

Submission status: Accepted

Solution code:
while 1:
	n=input()
	if n==0:break
	print n-sum([int(raw_input()) for i in range(9)])

Submission status: Accepted

Solution code:
while True :
    n = int(input())
    if n == 0 :
        break
    
    S = 0
    for i in range(9) :
        S += int(input())
    print(n - S)

Submission status: Accepted

Solution code:
while 1:
    t = int(input())
    if t == 0:
        break
    for i in range(9):
        n  = int(input())
        t -= n
    print(t)

Submission status: Accepted

Solution code:
while True:
	total=int(input())
	if total==0:exit(0)
	print(total-sum([int(input()) for _ in range(9)]))

Submission status: Accepted

Solution code:
while True:
    kei = int(input())
    if kei == 0:
        break
    else:
        for num in range(9):
            i = int(input())
            kei -= i
        print(kei)

Submission status: Accepted

Solution code:
N=0
for i in range(7):
  N=int(input())
  if N==0:
    break
  for j in range(9):
    N=N-int(input())
  print(N)

Submission status: Accepted

Solution code:
while True:
    try:
        print(int(input())-sum([int(input()) for i in range(9)]))
    except:
        break

Submission status: Accepted

Solution code:
while 1:
    n = int(input())
    if n == 0:
        break
    for _ in range(9):
        n -= int(input())
    print(n)

Submission status: Accepted

Solution code:
while 1:
    n=int(input())
    if n==0:
        break
    else:
        for i in range(9):
            b=int(input())
            n-=b
        print(n)

Submission status: Accepted

Solution code:
while True:
    t = int(input())
    if t == 0:
        break
    b = [int(input()) for i in range(9)]
    print(t-sum(b))

Submission status: Accepted

Solution code:
#A問題
ans = 0
for i in range(50):
    a = int(input())
    if i%10 == 0 and a!=0:
        ans+=a
    elif a != 0:
        ans-=a
        if i%10 == 9:
            print(ans)
            ans = 0
    else:
        break

Submission status: Accepted

Solution code:
while True:
    s = int(input())
    li = []
    if s == 0:
        break
    for i in range(9):
        s -= int(input())
    print(s)

Submission status: Accepted

Solution code:
def solve(sum_val):
    tmp = 0
    for x in range(9):
        tmp += int(input())
    print(sum_val - tmp)


ipt = int(input())
while ipt != 0:
    solve(ipt)
    ipt = int(input())

Submission status: Accepted

Solution code:
J=[]
while True:
    sum=int(input())
    if sum==0:
        for k in range(len(J)):
            print(J[k])
        break
    else:
        a=int(input())
        b=int(input())
        c=int(input())
        d=int(input())
        e=int(input())
        f=int(input())
        g=int(input())
        h=int(input())
        i=int(input())
        J.append(sum-a-b-c-d-e-f-g-h-i)

Submission status: Accepted

Solution code:
while (True):

  total = int(input())

  if (total == 0):
    break

  others = 0
  for i in range(9):
    others += int(input())

  print(total-others)

Submission status: Accepted

Solution code:
while True:
    k = int(input())
    if k == 0:
        exit()
    else:
        for i in range(9):
            k -= int(input())
        print(k)

Submission status: Accepted

Solution code:
while 1:
    l = []
    sm = int(input())
    if sm == 0:
        break
    for i in range(9):
        l.append(int(input()))
    print(sm - sum(l))

Submission status: Accepted

Solution code:



while True:

    a = int(input())

    if a == 0:
        break
    for i in range(9):

        b = int(input())

        a -= b

    print (a)

Submission status: Accepted

Solution code:
b=True
while b:
	n=int(input())
	if n==0:
		break
	for i in range(9):
		n-=int(input())
	print(n)

Submission status: Accepted

Solution code:
def main():
    while True:
        c = int(input())
        if c == 0:
            return
        print(c - sum([int(input()) for _ in range(9)]))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
while True:
    x = int(input())
    if x == 0:
        break
    for i in range(9):
        x -= int(input())
    print(x)

Submission status: Accepted

Solution code:
while True:
    sum_ = int(input())
    if not sum_:
        break
    ans = sum_ - sum([int(input())for _ in range(9)])
    print(ans)

Submission status: Accepted

Solution code:
while 1:
    ans=int(input())
    if ans==0:break
    for i in range(9):
        ans-=int(input())
    print(ans)

Submission status: Accepted

Solution code:
while 1:
    total = int(input())
    if total == 0:
        break

    tmp = 0
    for _ in range(9):
        tmp += int(input())

    print(total - tmp)

Submission status: Accepted

Solution code:
while True:
    all = input()
    if all == 0:
        break
    else:
        for i in range(9):
            price = input()
            all -= price
        print all