Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

const (
	LAST_MONTH = 4280
	BASE = 1150
)

func main() {
	for scanner.Scan() {
		w, _ := strconv.Atoi(scanner.Text())
		if w < 0 {
			break
		}
		s := BASE
		if  10 < w {
			if w <= 20 {
				s+= (w-10)*125
			} else {
				s+= 1250
			}
		}
		if 20 < w {
			if w <= 30 {
				s += (w-20)*140
			} else {
				s += 1400
			}
		}
		if 30 < w {
			s += (w-30)*160
		}
		fmt.Println(LAST_MONTH-s)
	}
}

C++: #include <algorithm>
#include <iostream>

using namespace std;

int main() {
  int w;
  while (true) {
    int x = 1150;
    cin >> w;
    if (w < 0) {
      return 0;
    }
    w -= 10;
    if (w > 0) {
      x += 125 * min(10, w);
    }
    w -= 10;
    if (w > 0) {
      x += 140 * min(10, w);
    }
    w -= 10;
    if (w > 0) {
      x += 160 * w;
    }
    cout << 4280 - x << endl;
  }
}

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

int main() {
  while(1) {
    int w;
    cin >> w;
    int cost = 0;
    if(w == -1) break;
    cost += 1150;
    int temp;
    if(w > 30) {
      temp = w - 30;
      cost += temp * 160;
      w -= temp;
    }
    if(w > 20) {
      temp = w - 20;
      cost += temp * 140;
      w -= temp;
    }
    if(w > 10) {
      temp = w - 10;
      cost += temp * 125;
      w -= temp;
    }

    cout << 4280 - cost << endl;
  }
  return 0;
}

C++: #include<iostream>
using namespace std;
int getCost(int w){
 int cost = 1150; // ?¬¬?????????
 for (int i = 11; i <= w; i++ ){
 if ( i <= 20 ) cost += 125; // ?¬¬?????????
 else if ( 30 < i ) cost += 160; // ?¬¬?????????
 else cost += 140; // ?¬¬?????????
 }
 return cost;
}
int main(){
 for( int w; cin >> w && w >= 0; ) {
 cout << 4280 - getCost(w) << endl;
 }
 return 0;
}

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

int prise(int water, int count){
	if(count==0) return water*125;
	if(count==1) return water*140;
	return water*160;
}

int main(){
	int prev=4280, water;
	while(cin >> water){
		if(water<0) break;
		int sum=1150, count=0;
		water-=10;
		while(water >= 0){
			if(water >= 10){
				sum += prise(10,count);
				count++;
			}
			else{
				sum += prise(water,count);
			}
			water-=10;
		}
		cout << prev - sum << endl;
	}
	return 0;
}

C++: #include<iostream>

using namespace std;


int main(){

  int in, data[4];

  while(1){

    cin >> in;

    if(in == -1) break;

    int w = 1150;

    for(int i = 0; i < 3; i++){
      if(in >= 10) data[i] = 10;
      else data[i] = in;
      in -= 10;
    }
    data[3] = in;

    for(int i = 0; i < 4; i++){
      if(data[i] < 0) data[i] = 0;
    }

    w += 125 * data[1];
    w += 140 * data[2];
    w += 160 * data[3];
    w = 4280 - w;
    cout << w << endl;
  }

  return 0; 
}

C++: #include<stdio.h>
#include<string.h>
int main(void)
{
	int a,s,d,f,g,h,i,j;
	scanf("%d",&a);
	while(a!=-1){
		s=4280-1150;
		if(a>10&&a<=20){
			s=4280-(a-10)*125+1150;
		}
		if(a>20&&a<=30){
			s=4280-((a-20)*140+1250+1150);
		}
		if(a>30){
			s=4280-((a-30)*160+1250+1400+1150);
		}
		printf("%d\n",s);
		scanf("%d",&a);
	}
	return 0;
}

C++: #include<stdio.h>
int main(){
int W,T=4280;
int d=0,x=0;
while(1){
scanf("%d",&W);if(W==-1)break;
T=T-1150;
if(W<=10){printf("%d\n",T);}
else if(W<=20){d=125*(W-10);T=T-d;printf("%d\n",T);}
else if(W<=30){d=140*(W-20);T=T-d-1250;printf("%d\n",T);}
else if(W>30){d=160*(W-30);T=T-d-1250-1400;printf("%d\n",T);}
}
return 0;
}

C++: #include<cstdio>
#include<cstring>
#include<algorithm>
#include<functional>
#include<vector>
#include<stack>
#include<queue>
#include<iostream>
using namespace std;
int main(void)
{
	int p,i,j,n,sum,ki;
	while(1) {
		cin >> n;
		if(n==-1) break;
		sum=1150;
		for(i=10;i<=n;i++) {
			if(i>10 && i<=20) sum+=125;
			if(i>20 && i<=30) sum+=140;
			if(i>30) sum+=160;
		}
		ki=4280;
		cout << ki-sum <<endl;
	}
	exit(0);
}

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

using namespace std;
#define loop(i,a,b) for(int i=(a); i<int(b); i++)
#define rep(i,b) loop(i,0,b)

int main(){
	int n;
	while(cin >> n, n!=-1){
		int ans = 0;
		if(30 < n){ans += (n-30) * 160; n = 30;}
		if(20 < n){ans += (n-20) * 140; n = 20;}
		if(10 < n){ans += (n-10) * 125; n = 10;}
		ans += 1150;
		cout << 4280-ans << endl;
	}
}

C++: #include<iostream>
using namespace std;
int getCost(int w){
 int cost = 1150; // ?¬¬?????????
 for (int i = 11; i <= w; i++ ){
 if ( i <= 20 ) cost += 125; // ?¬¬?????????
 else if ( 30 < i ) cost += 160; // ?¬¬?????????
 else cost += 140; // ?¬¬?????????
 }
 return cost;

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

int main(){
int w,money,flag,i;
    while(1){
        money = 1150;
        cin >> w;
        if(w == -1){
            break;
        }
        if(w <= 10){
            cout << 4280 - money << endl;
        }
        else {
            w -= 10;
            flag = 9;
            for(i=w;i>=1;i--){
                flag++;
                if(flag < 20){
                    money += 125;
                }
                else if(flag < 30){
                    money += 140;
                }
                else if(flag < 40){
                    money += 160;
                }
                else if(flag >= 40){
                    money += 160;
                }
            }
            cout << 4280 - money << endl;
        }
    }
}

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

int main(){
	const int n = 4280;
	int w;
	while( cin >> w , ~w ){
		int sum = 1150;
		if( w <= 10 ){
		}else if( w <= 20 ){
			sum += (w-10)*125;
		}else if( w <= 30 ){
			sum += 1250 + (w-20)*140;
		}else{
			sum += 1250 + 1400 + (w-30)*160;
		}
		cout << n - sum << endl;
	}
}

C++: #include<cstdio>
using namespace std;
int main(){
    int n;
    while(1){
        scanf("%d",&n);
        if(n == -1)break;
        int ans = 0;
        ans = 1150;
        if(n <= 10){printf("%d\n",4280-ans);continue;}
        n = n - 10;
        if(n <= 10){
            ans += 125*n;
            printf("%d\n",4280-ans);
            continue;
        }
        ans += 1250;
        n = n - 10;
        if(n <= 10){
            ans += 140*n;
            printf("%d\n",4280-ans);
            continue;
        }
        ans += 1400;
        n = n - 10;
        //printf("n = %d\n",n);
        ans += n*160;
        printf("%d\n",4280 - ans);
    }
    return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
typedef long long ll;
int main() {
  int n;
  while(1) {
    cin >> n;
    if(n == -1) break;
    int cost;
    if(n <= 10) cost = 1150;
    else if(n <= 20) cost = 1150 + 125 * (n - 10);
    else if(n <= 30) cost = 1150 + 125 * 10 + 140 * (n - 20);
    else cost = 1150 + 125 * 10 + 140 * 10 + 160 * (n - 30);
    cout << 4280 - cost << endl;
  }
  return 0;
}

C++: #include <iostream>

using namespace std;

int main(int argc, char **argv)
{
  int w, c;

  while(1){
    cin >> w;
    if(w == -1){
      break;
    }
    c = 1150;

    w -= 10;
    if(w <= 0){
      cout << (4280-c) << endl;
      continue;
    }

    w -= 10;
    if(w <= 0){
      cout << (4280-(c+(w+10)*125)) << endl;
      continue;
    }
    c += 1250;
    w -= 10;
    if(w <= 0){
      cout << (4280-(c+(w+10)*140)) << endl;
      continue;
    }
    c += 1400;

    cout << (4280-(c+160*w)) << endl;
  }

  return 0;
}

C++: using namespace std;
#include <iostream>
#include <string>
#include <set>
#include <functional>
#include <vector>
#include <algorithm>
#include <stdio.h>
int main()
{
	int n;
	while(cin>>n&&n!=-1){
		int ans=1150;
		if(10<n)ans+=min(10,(n-10))*125;
		if(20<n)ans+=min(10,(n-20))*140;
		if(30<n)ans+=(n-30)*160;
		cout<<4280-ans<<endl;
	}
    return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
	int x;
	while(1){
		cin>>x;
		if(x==-1) break;
		else if(0<=x&&x<=10) cout<<4280-1150<<endl;
		else if(11<=x&&x<=20) cout<<4280-1150-125*(x-10)<<endl;
		else if(21<=x&&x<=30) cout<<4280-1150-125*10-140*(x-20)<<endl;
		else if(31<=x&&x<=40) cout<<4280-1150-125*10-140*10-160*(x-30)<<endl;
	}
}