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;
        
const int p=4280,a[3]={125,140,160};
        
int main(void){
        
int w;
        
while(true){
cin >> w;
if(w==-1)break;
        
int res=1150;
w-=10;       
 
for(int i=0;i<2;i++){
if(w<=0)break;
if(w>9){
w-=10;
res+=10*a[i];
}
else {
res+=w%10*a[i];
break;
}
}
if(w>0)res+=w*a[2];
cout << p-res << endl;
}
        
return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  while(n!=-1){
    int a=1150;
    if(n>10){
      if(n>20){
	a+=1250;
	if(n>30){
	  a+=1400+160*(n-30);
	}else{
	  a+=140*(n-20);
	}
      }else{
	a+=125*(n-10);
      }
    }
    cout<<4280-a<<endl;
    cin>>n;
  }
  return 0;
}

C++: File Edit Options Buffers Tools C++ Help                                                                 
#include<iostream>
#include<string>
#include<cmath>
#include<vector>
#include<stack>
#include<queue>
#include<algorithm>
#include<complex>
using namespace std ;
typedef vector<int> vi ;
typedef vector<vi> vvi ;
typedef vector<string> vs ;
typedef pair<int, int> pii;
typedef long long ll ;

#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define rep(i,a) loop(i,0,a)
#define all(a) (a).begin(),(a).end()

int main(void){
  int n;
  while(cin>>n,n!=-1){
    int sum = 0 ;
    if(n <= 10)sum = 1150 ;
    else if(n <= 20)sum += 1150 + (n-10) * 125;
    else if(n <= 30)sum += 1150 + 1250 + (n-20) * 140;
    else sum += 1150 + 1250 + 1400 + (n-30) * 160;

    cout<<4280-sum<<endl;

  }
}

C++: #include<iostream>
using namespace std;
int n,ans;
int main(){
  while(1){
    cin>>n;
    if(n==-1)break;
    ans=1150;
    if(n>=10)ans+=min(10,n-10)*125;
    if(n>=20)ans+=min(10,n-20)*140;
    if(n>=30)ans+=(n-30)*160;
    cout<<4280-ans<<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>

using namespace std;

int main() {
  int n;
  while(cin >> n && n >= 0) {
    int res = 3130;    
    for(int i=11; i<=n; i++) {
      if(i<=20) res -= 125;
      else if(i<=30) res -= 140;
      else if(i<=40) res -= 160;
    }
    cout << res << endl;
  }
  
  return 0;
}

C++: #include<iostream>

using namespace std;

int main()
{
	int n;
	int i;
	
	for(;;)
	{
		cin >> n ;
		if(n==-1)
			break;
		
		int ans=0;
		
		if(n>=30)
		{
			ans+=(n-30)*160;
			ans+=1400;
			ans+=1250;
			ans+=1150;
		}
		else if(n>=20)
		{
			ans+=(n-20)*140;
			ans+=1250;
			ans+=1150;
		}
		else if(n>=10)
		{
			ans+=(n-10)*125;
			ans+=1150;
		}
		else
			ans=1150;
		cout << 4280-ans << endl;
	}
}

C++: #include <iostream>
using namespace std;
int main(){
	while(1){
		int w;
		cin>>w;
		if(w==-1) break;
		if(w<=10){
			cout<<4280-1150<<endl;
		}else if(w<=20&&w>=11){
			cout<<4280-1150-125*(w-10)<<endl;
		}else if(w<=30&&w>=21){
			cout<<4280-1150-125*10-140*(w-20)<<endl;
		}else if(w>=31){
			cout<<4280-1150-125*10-140*10-160*(w-30)<<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;

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
	int w;
	while(1){
		cin>>w;
		if(w==-1)break;
		int res=1150;
		if(w>10)res+=(w-10)*125;
		if(w>20)res+=(w-20)*15;
		if(w>30)res+=(w-30)*20;
		cout<<4280-res<<endl;
	}
}

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

int main(){
	int n;
	while(cin>>n,n>0){
		int sum=0;
		while(n>9){
			if(30<n){;sum+=160*(n-30);n=30;}
			else if(20<n){sum+=140*(n-20);n=20;}
			else if(10<=n){sum+=125*(n-10);n=0;}
			//cout<<n<<" "<<sum<<endl;
		}
		sum+=1150;
		cout<<4280-sum<<endl;
	}

}

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

#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define EPS 1e-8
#define F first
#define S second
#define mkp make_pair

static const double PI=6*asin(0.5);
typedef long long ll;
typedef complex<double> CP;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vint;
static const int INF=1<<24;

template <class T>
void initvv(vector<vector<T> > &v,int a,int b, const T  &t = T()){
	v.assign(a,vector<T>(b,t));
}

//v.erase(unique(v.begin(),v.end()),v.end());

int a[30];
int main(){
	int n;
	rep(i,11){
		a[i]=1150;
	}
	reep(i,11,21){
		a[i]+=a[i-1]+125;
	}
	reep(i,21,31){
		a[i]+=a[i-1]+140;
	}
	while(cin>>n,n!=-1){
		if(n>30){
			cout<<-a[30]-(n-30)*160+4280<<endl;
		}
		else{
			cout<<-a[n]+4280<<endl;
		}
	}
}

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

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

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 <stdio.h>

#define MYSCAN scanf

int main(void){
	int w = 0, ans = 0;
	int last = 4280;
	int base = 1150;

	while (true){

		MYSCAN("%d", &w);
		if (w == -1){ break; }
		if (w > 30){
			ans = (w - 30) * 160;
			ans += 140 * 10 + 125 * 10 + base;
		}else if (w > 20){
			ans = (w - 20) * 140;
			ans += 125 * 10 + base;
		}else if (w > 10){
			ans = (w - 10) * 125;
			ans += base;
		}
		else{
			ans = base;
		}
		printf("%d\n", last - ans);

	}	
	return 0;
}

C++: #include <cstdio>

int Solve(int w){
	int c = 1150;
	if(w > 30){
		c += (w - 30) * 160;
		c += 140 * 10;
		c += 125 * 10;
	}else if(w > 20){
		c += 140 * (w - 20);
		c += 125 * 10;
	}else if(w > 10){
		c += 125 * (w - 10);
	}
	return c;
}

int main(){
	int self;
	//int bf;
	while(1){
	
		scanf("%d",&self);
		if(self == -1){break;}
		printf("%d\n",4280 - Solve(self));
	}
	return 0;
}

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

int main(){
  int i,j,n,be,af;
  be = 4280;
  while(1){
    cin >> n;
    if(n == -1) break;

    af = 1150;
    if(n > 10 && n <= 20) af += (n - 10) * 125;
    else if(n > 20) af += 10 * 125;
    if(n > 20 && n <= 30) af += (n - 20) * 140;
    else if(n > 30) af += 10 * 140;
    if(n > 30) af += (n - 30) * 160;
    
    cout << be - af << endl;
    
  }
  return 0;
}