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<stdio.h>
int main(void)
{
    int a,x,y,v;
	scanf("%d",&a);
	x=4280-(a-10)*125-1150;
	y=4280-(a-20)*140-2400;
	v=4280-(a-30)*160-3800;
	if(a<=20){
	    printf("%d\n",x);
	}
	else if(a<=30){
	    printf("%d\n",y);
	}
	else if(30<=a){
	    printf("%d\n",v);
	}
	else if(a<=10){
	    printf("%d\n",3130);
	}
	return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
 
int main(void)
{
     int rate;
     while(cin.eof(),cin>>rate){


	  if(rate == -1) break;
	  else{
	       if(rate==0){
		    rate==0;
	       }
	       else{
		    rate-=10;
	       }
	       while(1){
		    if(rate >=0 && rate < 10){
			 rate*=125;
			 break;
		    }else if(rate >= 10 && rate < 20){
			 rate-=10;
			 rate*=140;
			 rate+=1250;
			 break;
		    }else if(rate >= 20 && rate <= 30){
			 rate-=20;
			 rate*=160;
			 rate+=2650;
			 break;
		    }
	       }
	       rate+=1150;
	       cout << 4280-rate << endl;
	  }
     }
     return 0;
}

C++: #include<stdio.h>

int main(void)
{
   while(1){
   int x=0;
   int y=0;

   scanf("%d",&x);
   if(x == -1){
    break;
   }
   if(x<=10){
        y=1150;
   } else if(10<x && x <= 20){
        
//        for(y=1150;x<=20;x++){
//        y+=125;  }
        int z = 11;
        for(y=1150;z<=x;z++){
        y+=125;  }

   } else if(20<x && x<=30){
//        for(y=1150;x<=20;x++){
//        y+=125;  }
//        for(y=1150;x<=30;x++){
//        y+=140;}
        int z = 11;
        for(y=1150;z<=20;z++){
        y+=125;  }
         for(;z<=x;z++){
        y+=140;}
 
   } else if(30<x){
         int z=11;
         for(y=1150;z<=20;z++){
        y+=125;  }
         for(;z<=30;z++){
        y+=140;}
        for(;x >= z;z++){
        y+=160;}
   } 
   printf("%d\n",4280 -y);
   }
return 0;
}

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