Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	io := NewIo()
	defer io.Flush()
	for {
		sum := io.NextInt();
		if sum == 0 {
			break
		}
		for i := 0; i < 9; i++ {
			sum -= io.NextInt()
		}
		io.Println(sum)
	}
}

// I/O template
type Io struct {
	reader    *bufio.Reader
	writer    *bufio.Writer
	tokens    []string
	nextToken int
}

func NewIo() *Io {
	return &Io{
		reader: bufio.NewReader(os.Stdin),
		writer: bufio.NewWriter(os.Stdout),
	}
}

func (io *Io) Flush() {
	err := io.writer.Flush()
	if err != nil {
		panic(err)
	}
}

func (io *Io) NextLine() string {
	var buff []byte
	for {
		line, isPrefix, err := io.reader.ReadLine()
		if err != nil {
			panic(err)
		}
		buff = append(buff, line...)
		if !isPrefix {
			break
		}
	}
	return string(buff)
}

func (io *Io) Next() string {
	for io.nextToken >= len(io.tokens) {
		line := io.NextLine()
		io.tokens = strings.Fields(line)
		io.nextToken = 0
	}
	s := io.tokens[io.nextToken]
	io.nextToken++
	return s
}

func (io *Io) NextInt() int {
	i, err := strconv.Atoi(io.Next())
	if err != nil {
		panic(err)
	}
	return i
}

func (io *Io) NextFloat() float64 {
	i, err := strconv.ParseFloat(io.Next(), 64)
	if err != nil {
		panic(err)
	}
	return i
}

func (io *Io) Println(a ...interface{}) {
	fmt.Fprintln(io.writer, a...)
}

func (io *Io) Printf(format string, a ...interface{}) {
	fmt.Fprintf(io.writer, format, a...)
}

func (io *Io) PrintIntSlice(a []int) {
	b := []interface{}{}
	for _, x := range a {
		b = append(b, x)
	}
	io.Println(b...)
}

func (io *Io) PrintStringSlice(a []string) {
	b := []interface{}{}
	for _, x := range a {
		b = append(b, x)
	}
	io.Println(b...)
}

func Log(name string, value interface{}) {
	fmt.Fprintf(os.Stderr, "%s=%+v\n", name, value)
}

func ExampleIo() {
	io := NewIo()
	defer io.Flush()
	a := make([]int, 0, 3)
	a[0], a[1], a[2] = io.NextInt(), io.NextInt(), io.NextInt()
	io.Println(a)
	io.PrintIntSlice(a)
	Log("io", a)
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <string>
#include <cmath>
#include <cstdio>
using namespace std;

#define PI 4*atan(1);

int main(){
  int sum;
  while(cin >> sum && sum){
    int p = 0, tmp;
    for(int i =0; i < 9; i++){
      cin >> tmp;
      p += tmp;
    }
    cout << sum - p << endl;
  }
}

C++: #include <iostream>
#include<stdio.h>
using namespace std;
 
int main(){
  int a,i;
  int hon[1001];

  i=0;
  hon[0]=0;
  scanf("%d",&a);
  while(1)
    {
      i=i+1;
      scanf("%d",&hon[i]);
      if(hon[i]==0)
	{
	  break;
	}
      hon[0]=hon[0]+hon[i];
    }

  i=a-hon[0];
  printf("%d\n",i);

  return 0;
}

C++: #include<iostream>
using namespace std;
#define N 10
int main(){
  while(true){
    int total;
    cin >> total;
    if( total == 0 ) break;
    for(int i = 0; i < N-1; ++i){
      int t;
      cin >> t;
      total -= t;
    }
    cout << total << endl;
  }
  return 0;
}

C++: #include <stdio.h>

int main(void){
	int a[10];
	int i;
	int x;
	for (i=0;i<=9;i++)
	{
		scanf("%d",&a[i]);
	}
	x=a[0];
	for(i=1;i<=9;i++){
		x=x-a[i];
	}
	printf("%d\n",x);
	return 0;
}

C++: #include <iostream>
using namespace std;

 
int main () 
{
  int i,a,r,t;
 while(cin>>a,a>0)
 {
  for(i=0;i<9;i++)
  {
   cin>>r;
   a=a-r;
  }
  cout<<a<<'\n';
  if(a==0)
     break;
}
   
  return 0;
}

C++: #include<stdio.h>
int main(){
  int total;
  int a[9];
  int i;
  scanf("%d",&total);
  for(i=0;i<9;i++){
    scanf("%d",&a[i]);
  }
  for(i=0;i<9;i++){
    total -= a[i];
  }
  printf("%d\n",total);
  return(0);
}

C++: #include<iostream>
using namespace std;

int main(){
int books=0;
int book=0;
cin>>books;
while(i<9){
cin>>book;
books-=book;
i++;
if(books==0){
break;
}
}
cout<<books<<'\n';

return 0;
}

C++: #include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define END << endl;
#define SP << " " << 
using namespace std;

int main(){
	int sum;
	cin >> sum;
	REP(i,9){
		int t;
		cin >> t;
		sum -= t;
	}
	cout << sum END
	
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;

int main(){
	while(1){
	int n,sougaku,kingaku=0;
	cin>>sougaku;
	if(sougaku==0) break;
	for(int i=0;i<9;i++){
	cin>>n;
	kingaku=kingaku+n;
	}
	cout<<sougaku-kingaku<<endl;
	}
	
    return 0;
}

C++: #include<iostream>
using namespace std;

int main()
{
    int n;

    while( cin >> n )
    {
        if( n == 0 )
            break;
        
        int p, sum = 0;
        for( int i = 0; i < 9; i++ )
        {
            cin >> p;
            sum += p;
        }
        cout << n - sum << endl;
    }
    return 0;
}

C++: #include<stdio.h>
int main()
{
	int sum, wa = 0, goukei[100] = { 0 }, i, r, cnt=0;
	while (1) {
		scanf("%d", &sum);
		if (sum == 0) {
			break;
		}
		for (i = 0; i < 9; i++) {
			scanf("%d", &r);
			wa = wa + r;
		}
		cnt++;
		goukei[cnt] = sum - wa;
	}
	for (i = 0; i < cnt; i++) {
		printf("%d\n", goukei[i]);
	}
}

C++: #include <iostream>

using namespace std;

int main(){
	int n, total, tmp;

	while (cin >> n){
		total = 0;
		if (n == 0){
			break;
		}

		for (int i = 0; i < 9; i++){
			cin >> tmp;

			total += tmp;
		}

		cout << n - total << endl;
	}
}

C++: #include <iostream>
using namespace std;
int main(){
     int a,b,n=1,i=0;
     cin>>a;
do{
    if(a>10000){
        break;
}  
     cin>>b;
     a=a-b;i++;
if(i=9*n){
     cout<<a<<endl;n++;
}
}while(i<=9*n);


return 0;
}

C++: #include<iostream>
using namespace std;

int main()
{
 int a; int b; int c; int d; int e; int f; int g; int h; int i; int j;
 cin >>a>>b>>c>>d>>e>>f>>g>>h>>i>>j;
 cout<<a-b-c-d-e-f-g-h-i-j; 


 return 0;
}

C++: //============================================================================
// Name        : receipt.cpp
// Author      : 
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
using namespace std;

int main() {
	int n, price[9], sum=0;
	cin >> n;
	for (int i = 0; i < 9; i++) {
		cin >> price[i];
		sum = sum + price[i];
	}
	cout << n - sum << endl;
	return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
    int n,m;
    for(;;){
        cin >> n;
        if(n==0) break;
        for(int i=0;i<9;i++){
            cin >> m;
            n-=m;
        }
        cout << n << endl;
    }
    return 0;
}

C++: 

2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 
#include <iostream>
#include <string>
using namespace std;
int main(){
int a;
int b;
int c;
int d;
int e;
int f;
int g;
int h;
int i;
int j;
while(cin >>a){
if(a==0){break;}
cin >>b;
cin >>c;
cin >>d;
cin >>e;
cin >>f;
cin >>g;
cin >>h;
cin >>i;
cin >>j;
cout << a-b-c-d-e-f-g-h-i-j<<endl;
}
}

C++: #include <cstdio>

int main(){
	int a,b,i;
	for(;scanf("%d",&a),a;){
		for(i=0;i<9;i++){
			scanf("%d",&b);
			a -= b;
		}
		printf("%d\n",a);
	}
}

C++: #include<iostream>
using namespace std;
int main(){
	int a,b;
	while(cin>>a&&a){
		for(int i=0;i<9;i++){
			cin>>b;
			a-=b;
		}
		cout<<a<<endl;
	}
	return 0;
}

C++: #include<bits/stdc++.h>

using namespace std;

int main(){
	int m,k;
	cin>>m;
	for(int n=1; n<10; n++ ){
	cin>>k;
	m-=k;
	}
	cout<<m<<endl;
	return 0;
}

C++: #include <iostream>
using namespace std;
int main()
{
	int sum,tmp;
	while (cin >> sum){
		if (!sum)break;
		for (int i = 0; i < 9; i++){
			cin >> tmp;
			sum -= tmp;
		}
		cout << sum << endl;
	}

}

C++: #include<iostream>
using namespace std;


int main(){
int i,a,t;
cin>>a;
while(t<9){
    cin>>i;
     if(i==0)
           break;
     else a=a-i;
t++;
}
cout<<a<<'\n';
 return 0;

}