Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	n, _ := strconv.Atoi(sc.Text())
	return n
}

func main() {
	sc.Split(bufio.ScanWords)

	sum := 0
	for i := 0; i < 5; i++ {
		x := nextInt()
		if x < 40 {
			sum += 40
		} else {
			sum += x
		}
	}
	fmt.Println(sum / 5)
}

C++: #include <iostream>
#include <stdio.h>
#include <string.h>
#include <functional>
#include <algorithm>
#include <string>
#include <vector>
#include <algorithm>
#include <time.h>
#include <stdlib.h>

using namespace std;

int main (void)
{
	int a[5],con;

	for (int i = 0; i < 5; i++)
	{
		cin >> a[i];
		if (a[i] < 40)
		{
			a[i] = 0;
			a[i] = 40;
		}
		else
		{
		}
		con += a[i];
	}

	cout << con / 5 << endl;
return 0;
}

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

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define repi(i,a,b) for(int i = (a); i < (b); i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

int main(){
	int sum = 0;
	rep(i, 5){
		int x;
		scanf("%d",&x);
		if(x<=40){
			x =40;
		}
		sum +=x;
	}
	printf("%d\n",sum/5);
	return 0;
}

C++: #include <iostream>
using namespace std;
int main(void)
{
	int a,b,c,d,e,f,g,h,i,j,k;
	float A;
	cin>>a>>b>>c>>d>>e;
	A=b-d;
	g=0;
	g++;
	for (;;)
	{
		A=A-d;
		if (A<=0)
		{
			g++;
			break;
		}
		else if (A>0)
		{
			g++;
		}
	}
	A=c-e;
	f=0;
	f++;
	for (;;)
	{
		A=A-e;
		 if (A<=0)
		{
			f++;
			break;
		}
		else if (A>0)
		{
			f++;
		}
	}
	if (f<=g)
	{
		g=a-g;
		cout<<g<<endl;
	}
	else if(f>=g)
	{ 
		f=a-f;
		cout<<f<<endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <array>
#include <vector>

using namespace std;

int main() {

  int sum = 0;
  for ( int i = 0; i < 5; i++ ){
	int val;
	cin >> val;
	sum += val;
  }
  cout << ( sum / 5 ) << endl;
}

C++: #include <iostream>
#include <stdio.h>
#include <string.h>
#include <functional>
#include <algorithm>
#include <string>
#include <vector>
#include <algorithm>
#include <time.h>
#include <stdlib.h>

using namespace std;

int main (void)
{
	int a[5],con;

	for (int i = 0; i < 5; i++)
	{
		cin >> a[i];
		if (a[i] < 40)
		{
			a[i] = 0;
			a[i] = 40;
		}
		
		con += a[i];
	}

	cout << con / 5 ;
}

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

int main()
{
	int ta,ji,sa,si,ha;

	cin >> ta;
	if (ta<40)
		ta=40;
	cin >> ji;
	if (ji<40)
		ji=40;
	cin >> sa;
	if (sa<40)
		sa=40;
	cin >> si;
	if (si<40)
		si=40;
	cin >> ha;
	if (ha<40)
		ha=40;




	cout << (ta+ji+sa+si+ha)/5 << endl;

	return 0;
}

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

int main(void){

  int buf,res=0;

  for(int i=0;i<5;i++){
    cin >> buf;
    if(buf < 40) buf = 40;
    res += buf;
  }

  res /= 5;

  cout << res << endl;
  
  return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;
int t,ans;
int main(){
	for(int i = 0;i < 5;i++)cin>>t,ans+=max(40,t);
	cout << ans/5 << endl;
}

C++: //============================================================================
// Name        : AOL.cpp
// Author      : Akari Fujii
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
using namespace std;

int main() {
int a,b,c,d,e;
cin>>a>>b>>c>>d>>e;

    if( a<40)a=40;

	if( b<40)b=40;

    if( c<40)c=40;

    if( d<40)d=40;

	if( e<40)e=40;
	cout<<(a+b+c+d+e)/5<<endl;
}

C++: #include <iostream>
using namespace std;
int main() {
	int a,b=0;
	for(int i=0;i<5;i++){
		cin>>a;
		if(a<40)a=40;
		b=b+a;
	}
	cout<<b/5<<endl;
	return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef complex<double> P;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define MOD (ll)(1e9+7)
#define ADD(a,b) a=((a)+(b))%MOD
#define FIX(a) ((a)%MOD+MOD)%MOD

int main(){
  int ret = 0;
  int t;
  REP(i,5){
    cin >> t;
    ret += t;
  }
  t /= 5;
  cout << t << endl;
  return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int n[5],i,s,ss;
	for(i=0;i<5;i++){
		scanf("%d",&n[i]);
		if(40>n[i]){
			n[i]=40;
		}
		s+=n[i];
	}
	ss=s/5;
	printf("%d\n",ss);
	return 0;
}

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

int score[5], total = 0, ave;
int main()
{
  for(int i = 0; i < 5; i++) cin >> score[i];
  for(int i = 0; i < 5; i++) total += (score[i] < 40) ? 40 : score[i];
  ave = total / 5;
  cout << ave << endl;
  return 0;
}

C++: #include<iostream>
#include<string>
#include<algorithm>	
#include<cmath>
using namespace std;
int main() {
	long long n, ans = 0; 
	for (int h = 0; h < 5; h++) {
		cin >> n;
		if (n > 40) {
			ans += n;
		}
		else {
			ans += 40;
		}
	}
	cout << ans / 5 << endl;
}

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

int main(void){
  int sum=0;
  int s;
  for(int i=0;i<5;i++){
    cin>>s;
    if(s<40)s=40;
    sum+=s;
  }
  cout<<sum/5<<endl;
  return 0;
}