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<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<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    while(cin>>n&&n!=-1){
        int sum=3130,num[3]={125,140,160};
        for(int i=0,j=n-10;i<3;i++,j-=10){
            if(n>10&&i!=2)sum-=num[i]*10;
            else if(n>0)sum-=num[i]*n;
        }
        cout<<sum<<endl;
    }
}

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);
		}
		if(t==20){
			printf("1880\n");
			}
		if(t==30){
			printf("480\n");
			}
	}
	return 0;
}

C++: #include <algorithm>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>

using namespace std;

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

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;

const int INF = 1001001001;

int main()
{
	int w;
	while(scanf("%d", &w), w!=-1){
		const int cost[] = {0, 125, 140};
		int c = 1150;
		rep(i, 3){
			int d = min(10, w);
			w -= d;
			c += d * cost[i];
		}
		c += w * 160;
		printf("%d\n", 4280-c);
	}
	return 0;
}

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

int main() {
	int mizu,kane,sa;
	kane=0;
	int n=1;
	while(n){
		
		cin >> mizu;
		
		if(mizu==-1) break;
		if(n!=1) cout << endl;
		if(mizu>10 && mizu<=20){
			mizu=mizu-10;
			kane=1150+mizu*125;
		}else if(mizu>20 && mizu<=30){
			mizu=mizu-20;
			kane=1150+1250+mizu*140;
		}else if(mizu<=10){
			kane=1150;
		}else if(mizu>30){
			mizu=mizu-30;
			kane=1150+1250+1400+(mizu*160);
		}
		n++;
		cout << 4280-kane ;
		}
	
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    int w, m;
   while(cin >> w && w > -1){
       if(w > 30){
           m = 1150 + 1250 + 1400 + 160*(w - 30);
       }else if(w > 20){
           m = 1150 + 1250 + 140*(w - 20);
       }else if(w > 10){
           m = 1150 + 125*(w - 10);
       }else{
           m = 1150;
       }
       cout << 4280 - m << endl;
   }
}

C++: #include<iostream>
using namespace std;
int main()
{
for(;;){
int w;
int l=4280;
int k=1150;
cin >> w;
if(w==-1)break;
if(w>20)k+=1250;
else if(10<w)k+=125*(w-10);
if(w>30)k+=1400;
else if(w>20)k+=140*(w-20);
if(w>30)k+=160*(w-30);
cout << k-l << "\n";
l=k;
}
return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <sstream>
using namespace std;



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

C++: #include <iostream>

using namespace std;

int main(int argc, char const* argv[])
{
	int w;
	
	while( cin >> w && w != -1 ){
		int money = 0;
		for( int i = 0;i <= w;i++ ){
			if( i > 30 ) money += 160;
			else if( i > 20 ) money += 140;
			else if( i > 10 ) money += 125;
		}
		money += 1150;
		cout << 4280 - money << endl;
	}
	return 0;
}

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

int main(){
	
	int w;
	while(cin>>w){
		int s=0;
		if(w!=-1){
		if(w<=10)
			s=1150;
		else if(w<=20)
			s=1150+(w-10)*125;
		else if(w<=30)
			s=1150+10*125+(w-20)*140;
		else if(w>30)
			s=1150+10*125+10*140+(w-30)*160;
			
		cout<<N-s<<endl;
	}
		else
			break;
	}
		
	
}

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){
			y=4280-1150;
			printf("%d\n",y);
			}
		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++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int w;
  cin>>w;
  while(w!=-1){
    int ans;
    int c=1150;
    w-=10;
    if(w>0){
      c+=125*min(w,10);
      w-=10;
    }
    if(w>0){
      c+=140*min(w,10);
      w-=10;
    }
    while(w>0){
      c+=160*min(w,10);
      w-=10;
    }
    
    ans=4280-c;
    cout<<ans<<"\n";
    cin>>w;
  }
  return 0;
}

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

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

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

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

#define pb push_back
#define in ,
#define rep(i, a, n) for(int i = (a); i < (n); i++)
#define dep(i, a, n) for(int i = (a); i >= (n); i--)
#define mod 1e9+7

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

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

C++: // 2012/07/09 Tazoe

#include <iostream>
using namespace std;

int main()
{
	while(true){
		int w;
		cin >> w;

		if(w==-1)
			break;

		int bil;
		if(w<=10){
			bil = 1150;
		}
		else if(w<=20){
			bil = 1150+(w-10)*125;
		}
		else if(w<=30){
			bil = 1150+10*125+(w-20)*140;
		}
		else{
			bil = 1150+10*125+10*140+(w-30)*160;
		}

		cout << 4280-bil << endl;
	}

	return 0;
}