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++: // #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

#define debug(...) fprintf(stderr, __VA_ARGS__)
#define int long long int
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
typedef pair<int, int> pii;
typedef long long ll;
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1001001001001001LL;
const ll MOD = 1000000007LL;
 
signed main() {
    int N;
    while(cin >> N, N != -1) {
        int money = 0;
        money += 1150, N -= min(N, 10LL);
        money += min(N, 10LL) * 125, N -= min(N, 10LL);
        money += min(N, 10LL) * 140, N -= min(N, 10LL);
        money += 160 * N;

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

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

C++: #include <bits/stdc++.h>
using namespace std;
int main(void){
    // Your code here!
    vector<int> a(0);
    while (true){
        int ai;
        cin >> ai;
        if (ai == -1) break;
        a.push_back(ai);
    }
    for (int i=0;i<a.size();i++){
        if (a.at(i)<10) cout << 4280-1150 << endl;
        else if (a.at(i)<20) cout << 4280-(1150+(a.at(i)-10)*125) << endl;
        else if (a.at(i)<30) cout << 4280-(2400+(a.at(i)-20)*140) << endl;
        else cout << 4280-(3800+(a.at(i)-30)*160) << endl;
    }
}

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

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

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

int main() {
	const int last = 4280;	//???????°´?????????
		while(true) {
			int water;
			cin >> water;
			if (water < 0) return 0;
			
			int bill = 1150;	//?????¬??????
			water -= 10;	//?¬¬???????????????????°?
			
			int extra[2]{125, 140};	//?¬¬2????¬¬3???????????????
			for (int i = 0; i < 2 && water > 0; i++, water -= 10) {
				bill += extra[i] * min(water, 10);
			}
			
			if (water > 0) {	//?¬¬4??????????????????
				bill += 160 * water;
			}
			cout << last - bill << endl;	//???????°´?????????4280?????¨??????
		}
}

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

int main(void){
  
  int w,a[3]={125,140,160};
  
  while(cin >> w,~w){
    int res=1150;
    w-=10;      
    
    for(int i=0;i<3 && 0<w;i++){
      if(9<w  && i<2)w-=10,res+=10*a[i];
      else{
	res+=w*a[i];
	break;
      }
    }
 
    cout << 4280-res << endl;
  }
  
  return 0;
}

C++: #include<iostream>
#include<vector>
using namespace std;
int main() {
	vector<int>w;
	int t;
	while (cin >> t){
		if (t == -1)
			break;
		else if (t <= 10)
			w.push_back(1150);
		else if (t <= 20)
			w.push_back(1150 + (t - 10) * 125);
		else if (t <= 30)
			w.push_back(2400 + (t - 20) * 140);
		else
			w.push_back(3800 + (t - 30) * 160);
	}
	for (int i = 0; i != w.size(); i++){
		cout << w[i] << endl;
		if (i == 0)
			cout << 4280 - w[i];
		else cout << w[i - 1] - w[i];
		cout << endl;
	}
	char c;
	cin >> c;
}

C++: #include<iostream>
#include<vector>
using namespace std;
int main() {
	vector<int>w;
	int t;
	while (cin >> t){
		if (t == -1)
			break;
		else if (t <= 10)
			w.push_back(1150);
		else if (t <= 20)
			w.push_back(1150 + (t - 10) * 125);
		else if (t <= 30)
			w.push_back(2400 + (t - 20) * 140);
		else
			w.push_back(3800 + (t - 30) * 160);
	}
	for (int i = 0; i != w.size(); i++){
		cout << 4280 - w[i];
		cout << endl;
	}
	char c;
	cin >> c;
}

C++: #include<stdio.h>
int main(void)
{
		int n,t,i,k,j,g,s;
	while(1)	{
		scanf("%d",&t);
		if(t==-1)	break;
		if(10>=t){
			printf("3130\n");
			}
		if(t>10&&t<20){
			n=t-10;
			i=4280-(n*125+1150);
			printf("%d\n",i);
			}
		if(t>20&&t<30){
			k=t-20;
			j=4280-((k*140)+2400);
			printf("%d\n",j);
		}
		 if(t>30){
			s=t-30;
			g=4280-((s*160)+3800);
			printf("%d\n",g);
		}	
	}
	return 0;
}

C++: import java.util.Scanner;
public class P01{

public P01(){
Scanner scan = new Scanner(System.in)
for(int w; scan.hasNextInt() && w >= 0;){
 System.out.println( 4280-getCost(w));
}
}
public 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;
}
public static void main(String[] args){
 P01 p01 = new P01();
 }
}

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

C++: #include<iostream>
using namespace std;
int fee[] = {0, 125, 140, 160};

int calc(int w){
  int res = 1150;
  if(10 < w && w <= 20){
    return res + (w - 10)*125;
  }else if(20 < w && w <= 30){
    return res + 1250 + (w - 20)*140;
  }else if(30 < w){
    return res + 1250 + 1400 + (w - 30)*160;
  }else{
    return res;
  }
}

int main(int argc, char *argv[]){
  int fee = 0, w;
  while(cin >> w){
    if(w == -1)break;
    std::cout << 4280 - calc(w) << std::endl;
  }
  return 0;
}

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

int main(){
	for(int i=0; i<205; i++){
      int w;
      cin >> w;
      if(w == -1 ){
        break;
      }else if(0 <= w && w <= 10){
        cout << 4280 - 1150 <<endl;
      }else if(w <= 20){
        cout << 4280 - (1150 + 125*(w - 10)) << endl;
      }else if(w <= 30){
        cout << 4280 - (2400 + 140*(w - 20)) << endl;
      }else{
        cout << 4280 - (3800 + 160*(w - 30)) << endl;
      }
    }
  return 0;
}