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>

	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 ;

		return 0;
	}

C++: #include<stdio.h>

int main(){

int x,y;

scanf("%d",&x);
for(int i=0;i<9;i++)
{scanf("%d",&y);x=x-y;}
printf("%d\n",x);
return 0;
}

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

int main()
{
  int ans,book,sum,show = 0;

  for(int j=1; j>0;){
  cin >> ans;
  
  sum = 0;

  if(ans == 0){
      break;
      }

  for(int i=0; i<9; i++){
    cin >> book;
    sum += book;
    // cout << sum << endl;
  }
  ans -= sum;
  
  cout << ans  << endl;
  }
}

C++: #include <cstdio>

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

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

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

int main() {
  while(1) {
    int total;
    cin >> total;
    if(total == 0) break;

    for(int i = 0; i < 9; i++) {
      int price;
      cin >> price;
      total -= price;
    }
    cout << total << endl;
  }
  return 0;
}

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

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

C++: #include<stdio.h>
int main(void)
{
	int x,a,b,c,d,e,f,g,h,i,j;
	scanf("%d %d %d %d %d %d %d %d %d %d",&x,&a,&b,&c,&d,&e,&f,&g,&h,&i);
	j=x-(a+b+c+d+e+f+g+h+i);
	printf("%d\n",j);
	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 total1 = 0;
  int total2 = 0;
  cin >> total1;
  for(int i = 0; i < 9; ++i) {
    int cost;
    cin >> cost;
    total2 += cost;
  }
  cout << total1 - total2 << endl;
  return 0;
}

C++: #include <iostream>

using namespace std;

int main() {
  while (true) {
    int a;
    cin >> a;
    if (a == 0) {
      break;
    }

    for (int i = 0; i < 9; i++) {
      int b;
      cin >> b;
      a -= b;
    }
    cout << a << endl;
  }
  return 0;
}

C++: #include <iostream>
using namespace std;
int main () {
int a,b,c,d,e,f,g,h,i,j;
cin>>a>>b>>c>>d>>e>>f>>g>>h>>i>>j;
cout<<a-(b+c+d+e+f+g+h+i+j)<<endl;
return 0;
}

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

int main(){
   int a, b, c, d, e, f, g, h, i, j, k;
   cin>>a;
   cin>>b;
   cin>>c;
   cin>>d;
   cin>>e;
   cin>>f;
   cin>>g;
   cin>>h;
   cin>>i;
   cin>>j;
   cin>>k;
   int x;
   x = a - (b + c + d + e + f + g + h + i + j);
   cout<<x<<endl;
  
   return 0;
}

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


return 0;
}

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


int main(){
   int n;
  cin>>n;

for(int i=0;n >= 0;i++){
  

  int sum = 0;
  while(1){
  int x;
  cin>>x;
  
  if(x == 0) break;

 sum = sum + x;

 }
  
  cout<<n-sum<<endl;
 }

  return 0;
}

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