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 <cstdio>
using namespace std;
int main()
{for(;;){
	int s,x;
	s=0;
	scanf("%d",&s);
	if(!s) return 0;
	for(int i=0;i<9;i++){
		scanf("%d",&x);
		s-=x;
	}
	printf("%d\n",s);
	}
}

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

#define for_(i,a,b) for(int i=(a);i<(b);++i)

int main() {
	int sum;
	
	while (cin >> sum, sum) {
		for_(i,0,9) {
			int sub;
			cin >> sub;
			sum -= sub;
		}
		
		cout << sum << endl;
	}
}

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

using namespace std;

#define REP(i, n) for(int i = 0; i < n; i++)

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    while (true) {
        int total_price;
        cin >> total_price;
        if (total_price == 0) break;

        int ans = total_price;
        int price;
        REP(i, 9) {
            cin >> price;
            ans -= price;
        }
        cout << ans << endl;
    }
    return 0;
}

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

int main() {
	int a[11], i;
	while (1){
		i = 1;
		cin >> a[0];
		if(a[0] == 0){break;}
		while (1){
			cin >> a[i];
			if (a[i] == 0){break;}
			a[0] = a[0] - a[i];
			if (a[0] == 0){break;}
			i++;		
		}
		cout << a[0] << endl;
	}
}

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

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

int main(){
	int total,book;
	int c=0;
	while(true)
	if(c==0){
		cin >> total;	
	}
	if(total==0){
		break;
	}
	c++;
	}else{
	cin >> book ;
	total -= book;
	c++;
	}
	if(c==10){
	cout << total << '\n';
	c==0;
	}	
	return 0;
}

C++: #include<cstdio>
using namespace std;
int main(void)
{
	int i,x,kin,gou,sa;
	x=0;
	scanf("%d",&gou);
	for(i=0;i<9;i++){
		scanf("%d",&kin);
		x+=kin;
	}
	sa=gou-x;
	printf("%d\n",sa);
	return 0;
}

C++: 	//キーボードから入力するコード
	#include <iostream>

	using namespace std;

	int main()
	{
		
		int all , a , b ;

		cin >> all ;
		cin >> b ;
		a=b;
		cin >> b ;
		a=a+b;
		cin >> b ;
		a=a+b;
		cin >> b ;
		a=a+b;
		cin >> b ;
		a=a+b;
		cin >> b ;
		a=a+b;
		cin >> b ;
		a=a+b;
		cin >> b ;
		a=a+b;
		cin >> b ;
		a=a+b;
	
		cout << all-a << '\n';

		return 0;
	}

C++: #include<bits/stdc++.h>
 
using namespace std;
 
int main(){
    int m,k;
    cin>>m;
    if(m=0){
    	return 0;
    }
    for(int n=0; n<9; n++ ){
    cin>>k;
    m-=k;
    }
    cout<<m<<endl;
    return 0;
}

C++: #include<iostream>
using namespace std;	
 
	int main(){
		int goke;
		int hon;
		int count=0;

	while(true){
		if(count==0){
		cin>>goke;
		if(goke==0){
		break;
		}
	count++; 
		}else{
		cin>>hon;
		goke-=hon;
		count++;
		}
		if(count==10){
		cout<<goke<<'\n';
		count=0;
		}
	}
	return 0;
}

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

int main() {

	//ifstream cin("INPUT.txt");
	//ofstream cout("OUTPUT.txt");

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

	return 0;

}

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

int main() {
	
	int a,i;
	
	
	while(cin>>a && a!=0){
	
		for(i=1;i<10;i++){
		int b;
		cin>>b;
		a=a-b;
		}
		cout<<a<<endl;
	}
	return 0;
}

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

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

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

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


return 0;
}

C++: #include <iostream>
using namespace std;
int main(void)
{
	for (;;)
	{
		int a,b,c,d;
		cin>>a;
		if (a==0)
		{
			break;
		}
		d=0;
		for (b=0;b<10;b++)
		{
			cin>>c;
			d=d+c;
		}
		b=a-d;
		cout<<b<<endl;
	}
	return 0;
}

C++: #include "stdio.h"
 
int main()
{
while(1)
{
int a;
scanf("%d",&a);
if(a == 0)
{
break;
}
for(int i = 0; i < 9; i++)
{
int w;
scanf("%d",&w);
a -= w;
}
printf("%d\n",a);
}
return 0;
}

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

int main(){
    int N, x;

    for(int j=0;j < 5;j++){
      cin>>N;
      if(N == 0) break;
      
      for(int i=0;i < 9;i++){
        cin>>x;
        N -= x;
      }
      cout<<N<<endl;
    }
    return 0;
}

C++: #include <iostream>
#include <vector>
#include <array>
#include <numeric>

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);

    int d;
    std::vector<int> data;

    while (std::cin >> d && d != 0) data.push_back(d);

    for (int i = 0; i < data.size() / 10; i++) {
        std::cout << data.at(i * 10) - std::accumulate(data.begin() + 1 + i * 10, data.begin() + 8 + i * 10, 0) << "\n";
    }

    return 0;
}

C++: #include <cstdio>

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

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

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

using namespace std;

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

C++: 	//キーボードから入力するコード
	#include <iostream>

	using namespace std;

	int main()
	{
		
		int all , a , b ;

		cin >> all ;
		cin >> b ;
		a=b;
		cin >> b ;
		a=a+b;
		cin >> b ;
		a=a+b;
		cin >> b ;
		a=a+b;
		cin >> b ;
		a=a+b;
		cin >> b ;
		a=a+b;
		cin >> b ;
		a=a+b;
		cin >> b ;
		a=a+b;
		cin >> b ;
		a=a+b;
	
		cout << all-a << '\n';

		return 0;
	}