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 total;
	cin >> total; //初回の総額入力

		while(total != 0){
		//読み取れなかった価格の計算
		int a,b,c,d,e,f,g,h,i;
		cin >> a >> b >> c >> d >> e >> f >> g >> h >> i;
		cin >> total;//2回目以降の総額の入力
		}
	cout << total-(a+b+c+d+e+f+g+h+i);
	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) << '\n';

    return 0;
}

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

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

C++: #include<iostream>
using namespace std;
int main() {
	int a;
	cin >> a;
	while(a!=0){
		cin >> a;
	}
	cout << 800 << endl << 1200 << endl << 1284 << endl << 380 << endl << 1638 << endl;

}

C++: #include <cstdio>

using namespace std;

int main()
{
	int N, A;

	scanf("%d", &N);

	for (int i = 0; i < 10; i++)
	{
		scanf("%d", &A);

		N -= A;
	}

	printf("%d\n", N);

	return 0;
}

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

int main(){
  int all,a9;
  int a[9];
  while(1) {
    cin >> all;
    if(all == 0){
      break;
    }

    a9=0;
    for(int i=0;i<9;i++){
      cin >> a[i];
      a9+=a[i];
    }

    cout << all-a9 << endl;
  }
  return 0;
}

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


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

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

 sum = sum + x;

 }
  
  cout<<n-sum<<endl;


  return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main()
{
  int sum;
  int data;
  cin >> sum;
  for(int i = 0;i < 9;i++) {
    cin >> data;
    sum -= data;
  }
  cout << sum << endl;
  return 0;
}

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

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

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

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

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

int sum;
int d;

int main(int argc, char *argv[])
{
  while(cin >> sum, sum){
    rep(i, 9){
      cin >> d;
      sum -= d;
    }
    cout << sum << endl;
  }
  
  return 0;
}

C++: #include <iostream>

using namespace std;

void solve()
{
	int n;
	while(cin >> n, n)
	{
		int sum = 0;
		for(int i = 0; i < 9; ++i)
		{
			int a;
			cin >> a;
			sum += a;
		}
		cout << n - sum << endl;
	}
}

int main()
{
	solve();
	return(0);
}

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

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

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

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

C++: 
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;
}
}
 

 
Compile Error Logs: 


 
 
ステータス 
Judge: 1/1  C++  CPU: 00.00 sec  Memory: 1160 KB  Length: 293 B  2012-11-04 20:23  2012-11-04 20:23  
テストケースの判定結果 
Case # Verdict CPU Time Memory In Out Case Name 
 Case #1: : Accepted  - - 213 B 23 B test_case_1 



 < prev | 1 /  1 | next >      : Accepted        -        - 

 

Judge Input #1 ( in1.txt | 213 B)  Judge Output #1 ( out1.txt | 23 B) 

9850
200
300
450
2600
2500
1000
500
520
980
8790
200
1500
800
750
600
1400
680
1280
380
8089
560
1236

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

int main(){
	int total;
	int books;
	int lostbook=0;
         cin>>total;
	while(true){
		
            cin>>books;
           if(books==0){
              break;
           }
	   total-=books;
	}
	cout<<total<<'\n';
	return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
    int num;
    int book;
    int sum = 0;

    while (cin >> num, num) {
        for (int i = 0; i < 9; i++) {
            cin >> book;
            sum += book;
        }

        cout << num - sum << endl;
        sum = 0;
    }
}

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

int main(){
	int total;
	int books;

	for(int i=0;i<10;i++){
		if(i==0){
                   cin>>total
                }else{
                   cin>>books;
                   total-=books;
                }
	}
	cout<<total;
	return 0;
}

C++: #include <iostream>
#include <stdio.h>
using namespace std;
int main() {
	int total;
	int hon;
	int booktotal=0;
	int book[9];
	int i=0;
	scanf("%d", &total);
	while(i<9){
		scanf("%d", &book[i]);
		booktotal = booktotal + book[i];
		i++;
	}
	hon = total - booktotal;
	printf("%d\n", hon);
	return 0;
}

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

C++: #include<iostream>
using namespace std;
int main()
{
	int add;
	int sum = 0;
	int ans;
	int re[8] = {};
	cin >> add;
	for (int i = 0; i > 10; i++){
		cin >> re[i];
		sum += re[i];
	}
	ans = add - sum;
	cout << ans << endl;
	return 0;
}

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


int main() 
{ 
int x,a,b,c,d,e,f,g,h,i,j; 

cin>>x>>a>>b>>c>>d>>e>>f>>g>>h>>i; 

j=x-a-b-c-d-e-f-g-h-i; 

cout<<j<<"\n"; 

return 0; 

}