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 <algorithm>
using namespace std;
int main(){
	
	int sum=0,tmp;
	for(int i=0;i<5;i++){
		cin>>tmp;
		sum+=(tmp<40?40:tmp);
	}
	cout<<sum/5<<endl;
	return 0;
}

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

int main(){
    int A[5];
    for(int i=0; i<5; i++){
        cin >> A[i];
        if(A[i]>40) continue;
        else A[i] = 40;
    }
    
    int sum=0;
    for(int j=0; j<5; j++){
        sum += A[j];
    }
    
    cout << sum/5 << endl;
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    int p = 0;
    for (int i = 0; i < 5; i++) {
        int t;
        cin >> t;
        if (t < 40) t = 40;
        p += t;
    }
    cout << p / 5 << "\n";
    return 0;
}

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

int main()
{
    int a[5],ans;
    while(cin>>a[0])
    {
        if(a[0]<40) a[0] = 40;
        for(int i=1;i<5;i++) {scanf("%d",&a[i]);if(a[i]<40) a[i] = 40;}
        ans = a[0]+a[1]+a[2]+a[3]+a[4];
        cout<<ans/5<<endl;
    }
    return 0;
}

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

int main(){
    int sum = 0, t;
    for(int i = 0;i<5;i++){
        cin >> t;
        sum += (t>=40?t:40);
    }
    cout << sum/5 << endl;
    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
cin.tie(0);
   	ios::sync_with_stdio(false);

int a,sum=0;
for(int i=0;i<5;i++){
cin >> a;
if(a<40)
sum+=40;
else
sum += a;
}
cout << sum/5 << "\n";
return 0;
}

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

int main(){
	int ave=0;
	for(int i=0;i<6;i++){
		int a;
		scanf("%d",&a);
		ave+=max(40,a);
	}
	printf("%d\n",ave/6);
}

C++: 
public class averagescore1 {

	public static void main(String[] args) {
import java.util.Scanner;
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		int[] score = new int [5];
		int i, sum = 0;
		for(i = 0; i < 5; i++){
			score[i] = sc.nextInt();
			if(score[i] < 40){
				score[i] = 40;
			}
		}
		//System.out.printf("%d\n", score[0]);
		for(int k = 0; k < 5; k++){
			sum = sum + score[k];
		}
		System.out.printf("%d\n", sum / 5);
	}

}

C++: #include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<complex>
#include<cmath>
#include<algorithm>
#include<map>
#include<vector>
#include<sstream>
#include<iostream>
using namespace std;
int main(void){

    int ans = 0,n = 5;
    while(n--){
        int x;
        cin>>x;
        ans += max(x,40)/5;
    }
    cout<<ans<<endl;


    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
	int p,sum=0;
	for(int i=0;i<5;i++){
		cin>>p;
		sum+=max(p,40);
	}
	cout<<sum/5<<endl;
}

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

using namespace std;

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

#define TT template<typename T>
TT T    sq(T x){ return x*x; }
TT int  ubnd(vector<T>& v,T x){ return upper_bound(v.begin(), v.end(), x) - v.begin(); }
TT int  lbnd(vector<T>& v,T x){ return lower_bound(v.begin(), v.end(), x) - v.begin(); }
TT void sort(T& v){ sort(v.begin(), v.end()); }
TT void revs(T& v){ reverse(v.begin(), v.end()); }
TT void uniq(T& v){ sort(v); v.erase(unique(v.begin(), v.end()), v.end()); }
TT void show(T& v,char d=' ',char e='\n'){for(int i=0;i<v.size();++i)cout<<v[i]<<((i==v.size()-1)?e:d);}
TT void inpt(vector<T>& v,int n){ v.reserve(n);for(int i=0;i<n;++i){T x; cin>>x; v.push_back(x);} }
TT T In(){ T x; cin >> x; return x; }

static inline void fast_io(){ ios::sync_with_stdio(0); cin.tie(0); }
static inline int in(){ int x; scanf("%d", &x); return x; }
static inline string instr(){ string x; cin >> x; return x; }
static const int dx[] = {0, 0, 1, -1, 1, 1, -1, -1};
static const int dy[] = {1, -1, 0, 0, 1, -1, 1, -1};

int main()
{
  int total = 0;
  for (int i = 0; i < 5; i++) total += max(40, in());
  printf("%d\n", total / 5);
  return (0);
}

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

int main() {
	int a[5];
	for(int i=0;i<5;i++){
		cin >> a[i] ;
	}
	for(int i=0;i<5;i++){
		if(a[i]<40){
			a[i]=40;
		}
	}
	cout << (a[0]+a[1]+a[2]+a[3]+a[4])/5 << endl;
	// your code goes here
	return 0;
}

C++: #include <cstdio>

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

C++: #include<iostream>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int main(){
	int dt;
	int sum=0;
	rep(i,5){
		cin>>dt;
		if(dt<40)dt=40;
		sum+=dt;
	}
	cout<<sum/5<<endl;
	return 0;
}

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

int main(){
	int a;
	int S=0;
	for(int i=0;i<5;i++){
		cin>>a;
		if(a<40){
			a=40;
		}			
		S+=a;		
	}
	S=S/5;	
	cout<<S<<endl;
}

C++: #include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<vector>
#include<deque>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<algorithm>
#include<functional>
#include<utility>
#include<bitset>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<cstdio>

using namespace std;

#define REP(i,n) for(int i=0;i<int(n);i++)
#define foreach(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
typedef long long ll;

int main(void){

	int x,i,s=0;
	for(i=1;i<=5;i++){
		cin >> x;
		if(x>=40) s+=x;
		else s+=40;
	}

	cout << s/5 << endl;

	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  int a[5];
  for(int i=0;i<5;i++){
    cin>>a[i];
    if(a[i]<40) a[i]=40;
  }
  int x=0;
  for(int i=0;i<5;i++){
    x+=a[i];
  }
  cout<<x/5<<endl;
  return 0;
}