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)
#define ALL e=a-d
#define LAST printf("%d",e)
#define QPR (10*125)
#define HKT scanf("%d",&w)
{
	int w;
	int a=4280,b=1150,c,d,e;
	
	HKT;
	while(w>1&&w<100)
	{
	if(w<=10)
	{
		e=a-b;
		LAST;
	}
	else if(w>10&&w<20)
	{
		c=w-10;
		d=b+(125*c);
		ALL;
	
	}
	else if(w>20&&w<30)
	{
		c=w-20;
		d=b+QPR+(c*140);
		ALL;
		LAST;
	}
	else if(w>30)
	{
		c=w-30;
		d=b+QPR+(10*140)+(c*160);
		ALL;
		LAST;
	}
	HKT;
	}
	
	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 main(){
	int n;
	while(cin>>n,n!=-1){
		int sum=0;
		while(n>10){
			if(30<n){n--;sum+=160;}
			else if(20<n){sum+=140;n--;}
			else if(10<=n){sum+=125;n--;}
			//cout<<n<<" "<<sum<<endl;
		}
		sum+=1150;
		cout<<4280-sum<<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;
}
int main(){
 for( int w; cin >> w && w >= 0; ) {
 cout << 4280 - getCost(w) << endl;
 }
 return 0;
}

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

int main() {
  int w, last = 4280;

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

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

int main(){
	int a,b;
	while(1){
		cin >> a;
		if(a ==- 1){
			return 0;
		}
		if(a<=10){
			b=1150;
		}
		else if(a<=20){
			b=125*a-100;
		}
		else if(a<=30){
			b=140*a-400;
		}
		else{
			b=160*a-1000;
		}
		b=4280-b;
		cout << b << "\n";
	}

	
	return 0;
}

C++: #define scanf_s scanf
#include <stdio.h>
#include <string>
#include <math.h>
#include <stack>
#include <queue>
#include <list>
#include <vector>
#include <iostream>
using namespace std;
#define MAE 4280
#define MAX 100
int main() 
{
	int w, ans = 0, m[5] = { 10,20,30}, n[5] = { 1150,125,140,160 };
	while (1) {
		scanf_s("%d", &w);
		if (w == -1) break;
		ans = n[0];
		if (m[0] < w) ans += (w - m[0] > 10 ? 10 : w - m[0]) * n[1];
		if (m[1] < w) ans += (w - m[1] > 10 ? 10 : w - m[1]) * n[2];
		if (m[2] < w) ans += (w - m[2]) * n[3];
		printf("%d\n", MAE - ans);
	}
}

C++: #include<iostream>
using namespace std;
int a, w;
int main() {
	while (true) {
		cin >> a;
		w = 1150;
		if (a == -1) { break; }
		for (int i = 0; i <= a; i++) {
			if (i > 30) { w += 160; }
			else if (i > 20) { w += 140; }
			else if (i > 10) { w += 125; }
		}
		cout << 4280 - w << endl;
	}
}

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

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

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0216

int calc(int w) {
	int sum = 1150;
	if (w < 10) return sum;
	sum += min(w - 10, 10) * 125;
	if (w < 20) return sum;
	sum += min(w - 20, 10) * 140;
	if (w < 30) return sum;
	sum += min(w - 30, 10) * 160;
	return sum;
}

int main() {
	int w;
	while (cin >> w) {
		if (w == -1) break;
		cout << (4280 - calc(w)) << 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;

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cmath>
#include <queue>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
const int INF = 1<<30;

int main() {
  int w;
  while(cin>>w,w!=-1) {
    int res = 1150;
    REP(i,w+1) {
      if (i>10 && i<=20) res += 125;
      else if (i>20 && i<=30) res += 140;
      else if (i>30) res += 160;
    }
    cout << 4280 - res << endl;
  }
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<sstream>
#include<numeric>
#include<cassert>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define rep(i,s,n) for(int i=(s); i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()
#define IN(x,s,g) ((x) >= (s) && (x) < (g))
#define ISIN(x,y,w,h) (IN((x),0,(w)) && IN((y),0,(h)))
#define print(x) printf("%d\n",x)

using namespace std;

typedef unsigned int uint;
typedef long long ll;

const int _dx[] = {0,1,0,-1};
const int _dy[] = {-1,0,1,0};

int getInt(){
  int ret = 0,c;
  c = getchar();
  while(!isdigit(c)) c = getchar();
  while(isdigit(c)){
    ret *= 10;
    ret += c - '0';
    c = getchar();
  }
  return ret;
}

int cost[4] = { 125, 140, 160 };

int main(){
  int w;
  while(scanf("%d",&w), w+1){
    int ans = 1150;
    w -= 10;
    for(int i=0; i < 2 && w > 0; i++){
      if(w >= 10){
	w -= 10;
	ans += cost[i] * 10;
      }else{
	ans += cost[i] * w;
	w = 0;
      }
    }
    if(w > 0)
      ans += 160 * w;

    print(4280 - ans);
  }
  return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){

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

return 0;
}

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

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