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++: 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 <cstdio>
#include <iostream>

using namespace std;

int main()
{
	int w;

	while (1){
		int rs;

		scanf("%d", &w);
		if (w == -1){
			break;
		}

		if (w <= 10){
			rs = 1150;
		}
		else if (w <= 20){
			rs = 1150 + (w % 10) * 125;
		}
		else if (w <= 30){
			rs = 1150 + 1250 + (w % 10) * 140;
		}
		else if (30 < w){
			rs = 1150 + 1250 + 1400 + (w % 30) * 160;
		}

		cout << 4280 - rs << endl;
	}

	return (0);
}

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define rep(i,n) for(i=0;i<n;i++)
#define loop(i,a,n) for(i=a;i<n;i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

typedef vector<int> vi;
typedef pair<int,int> pii;

int main(void) {
  int i,j;
  int n;
  while(1){
    cin>>n;
    if(n<0)break;
    int a=1150;
    n-=10;
    if(n>0){
      a+=125*min(10,n);
      n-=10;
    }
    if(n>0){
      a+=140*min(10,n);
      n-=10;
    }
    if(n>0){
      a+=160*n;
    }
    cout<<4280-a<<endl;
  }
}

C++: #include <iostream>
using namespace std;
#define debug(x) cout<<#x<<" : "<<x<<endl;
int n;
int fee[]={1150,125,140,160};
int phase[]={10,20,30,1000};
int main(){
  while(cin >> n,n+1){
    int pre=4280;
    int w=n;
    int money=fee[0];
    w-=phase[0];
    for(int i=1;w>0;i++){
      money+=min(phase[i]-phase[i-1],n-phase[i-1])*fee[i];
      w-=phase[i]-phase[i-1];
    }
    cout<<pre-money<<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <cstring>
#include <cstdlib>
#include <algorithm>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,b) FOR(i,0,b)
#define PB push_back
#define MP make_pair
int main(){
  int n,ans,frnt=4280;
  while(1){
    ans=1150;
    cin>>n;
    if(n==-1)break;
    if(n>=30)ans+=1250+1400+(n-30)*160;
    else if(n>=20)ans+=1250+(n-20)*140;
    else if(n>=10)ans+=(n-10)*125;
    cout<<frnt-ans<<endl;
  }
}

C++: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  int w;
  while (cin >> w, w != -1) {
    int cost = 1150;
    if (w > 30) {
      cost += (w - 30) * 160;
      w = 30;
    }
    if (w > 20) {
      cost += (w - 20) * 140;
      w = 20;
    }
    if (w > 10) {
      cost += (w - 10) * 125;
    }
    cout << 4280 - cost << endl;
  }

  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  while(true){
    int w;
    cin>>w; if(w==-1) break;
    if(w<=10) cout<<4280-1150<<"\n";
    w-=10;
    if(w<=10 && w>0) cout<<4280-(1150+w*125)<<"\n";
    w-=10;
    if(w<=10 && w>0) cout<<4280-(1150+10*125+w*140)<<"\n";
    w-=10;
    if(w>0) cout<<4280-(1150+10*125+10*140+w*160)<<"\n";
  }
      
    

  return 0;
}

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <complex>

#define FOR(i,b,n) for(int i=b;i<n;i++)
#define RFOR(i,b,n) for(int i=n-1;i>=b;i--)
#define CLR(mat) memset(mat, 0, sizeof(mat))
#define NCLR(mat) memset(mat, -1, sizeof(mat))

using namespace std;

typedef pair<int,int> paii;
typedef long long ll;

int main()
{
	int w;

	while(cin >> w, w >= 0)
	{
		int res = 1150;
		
		if( w > 10 )
			res += min(1250, (w-10)*125);
		if( w > 20 )
			res += min(1400, (w-20)*140);
		if( w > 30 )
			res += (w-30)*160;
			
		cout << 4280 - res << endl;
	}
	
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
    int a,x,y,v,k,j;
	scanf("%d",&a);
	while(1){
	    if (a<0){
        		break;
		}
		else if (a==0){
		    k=4280-1150;
		    printf("%d\n",k);
		}
		else if(30<=a){
		    j=1150+1250+1400+(a-30)*160;
			v=4280-j;
			printf("%d\n",v);
		}
		else if(a<=30){
		    j=1150+1250+(a-20)*140;
			y=4280-j;
			printf("%d\n",y);
		}
		else if(a<=20){
		    j=1150+(a-10)*125;
			printf("%d\n",x);
		}
		else if(a<=10){
		    k=4280-1150;
			printf("%d\n",k);
		}
	    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>
#include <iomanip>
#include <string> 
#include <vector> 
using namespace std;
  
int main(){
    /*??£???????????????????????????
            int a[2];
            cin >> a[1] >> a[2];
            cout << "[+] " << a[1] + a[2] << endl;
            cout << "[-] " << a[1] - a[2] << endl;
            cout << "[*] " << a[1] * a[2] << endl;
            cout << "[/] " << a[1] / a[2] << endl;
    */
    int a,ans,c = 0;
    while(cin >> a){
        ans = 1150;
        for(int i = 1;a >= i;i++){
            if(i > 10 and i <= 20){
                ans += 125;
            }
            if(i > 20 and i <= 30){
                ans += 140;
            }
            if(i > 30){
                ans += 160;
            }
        }
    ans = -ans + 4280;
    cout << ans << endl;
    }
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(){
  long long w[201];
  long long i=0,j=0;
  long long sum=4280;
  long long ans=0;
  long long a=125;
  long long b=140;
  long long c=160;
  while(1){
    cin >> w[i];
    if(w[i]==-1){
      break;
    }
    if(30<w[i]){
      ans=1150+a*10+b*10+c*w[i]-c*30;
    }else if(20<w[i]&&w[i]<=30){
      ans=1150+a*10+b*w[i]-b*20;
    }else if(10<w[i]&&w[i]<=20){
      ans=1150+a*w[i]-a*10;
    }else if(w[i]<=10){
      ans=1150;
    }
    cout << sum-ans <<endl;
    i+=1;
    ans=0;
  }
  return(0);
}