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>
using namespace std;
int main(){
	int a[5];
	int s=0;
	int i=0;
	for(i=0;i<5;i++){
		cin>>a[i];
		if(a[i]<40){
			a[i]=40;
		}
		s=s+a[i];
	}
	s=s/5;
	cout<<s<<endl;
}

C++: #include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <limits>
typedef long long ll;
#define REP(i,n)   for(int i=0; i<(int)(n); ++i)
#define FOR(i,b,e) for(int i=(b); i<=(int)(e); ++i)

#define in cin
#define out cout
#define pb push_back
using namespace std;

int main(){
	int a, b=0;
	REP(i, 5) {
		in >> a;
		if (a <= 40)a = 40;
		b += a;
	}

	
	out << b/5 << endl;
	return 0;

}

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;
}

C++: #include <iostream>
#include <fstream>
#include <typeinfo>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<25;
const double pi=acos(-1);
const double eps=1e-10;
const vi emp;

int sum;

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

C++: #include<iostream>

using namespace std;

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

C++: #include<iostream>

int main(){
	int a, b, c, d, e;
	std::cin >> a >> b >> c >> d >> e;
	int sum = 0;
	sum += (a > 40 ? a : 40) + (b > 40 ? b : 40) + (c > 40 ? c : 40) + (d > 40 ? d : 40) + (e > 40 ? e : 40);
	std::cout << sum / 5 << std::endl;
	return 0;
}

C++: #include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<long long> vll;
typedef pair<int,int> pint;
typedef pair<long long, long long> pll;

#define MP make_pair
#define PB push_back
#define ALL(s) (s).begin(),(s).end()
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P) 
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P) 
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P) 
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s; }


int a[5];

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

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

using namespace std;

int main() {
    int sum = 0;
    for (int i = 0; i < 5; ++i) {
        int s;
        cin >> s;
        if (s < 40) s = 40;
        sum += s;
    }
    cout << sum / 5 << '\n';
}

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

int main() {
    int ave = 0;
    for(int i=0;i<5;i++){
        int a;
        cin >> a;
        ave += max(40,a);
    }
    ave /= 5;
    cout << ave << endl;
    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <map>
#include <vector>

using namespace std;

int main() {
int a=0;
for(int i=0;i<5;i++){
int n;
if(n<40) n=40;
a=a+n;

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

C++: #include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <limits>
typedef long long ll;
#define REP(i,n)   for(int i=0; i<(int)(n); ++i)
#define FOR(i,b,e) for(int i=(b); i<=(int)(e); ++i)

#define in cin
#define out cout
#define pb push_back
using namespace std;

int main(){
	int a, b=0;
	REP(i, 5) {
		in >> a;
		b += a;
	}

	
	out << b/5 << endl;
	return 0;

}

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

int main(){
  int n,point,total=0;;
  for(int i = 0; i < 5; i++){
    cin >> point;
    if(point >= 40){
      total+=point;
    }else{
      total+=40;
    }
  }
  cout << total/5 << endl;
  return 0;
}

C++: #include <iostream>
using namespace std;
 
int main() {
  int n=0,sum=0,x;
  while(cin >> x) {
    if(x<=40) x=40;
    sum+=x;
    n++;
  }
  cout << sum/n << endl;
  return 0;
}

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

int main()
{
	//?????????
	int num1=0,num2=0,num3=0,num4=0,num5=0,num6=0;
	cin>>num1>>num2>>num3>>num4>>num5;
	if(num1<40){
		num1=40;
	}
	if(num2<40){
		num2=40;
	}
	if(num3<40){
		num3=40;
	}
	if(num4<40){
		num4=40;
	}
	if(num5<40){
		num5=40;
	}
	num6=(num1+num2+num3+num4+num5)/5;
	cout<<num6;
	cout<<"\n";
	return 0;
}

C++: 
#include <iostream>
using namespace std;
int main(){
	
	int a, b, c, d, e;
	cin >> a >>b >>c >>d >>e;
	int gokei = 0;
	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;
	}
	int answer = a+b +c +d + e;
	cout << answer << endl;

}

C++: #include <iostream>
#include <algorithm>

using namespace std;

int main() {
	
	int grade[5];

	while (cin >> grade[0]) {

		cin >> grade[1] >> grade[2] >> grade[3] >> grade[4];
		int sum = 0;

		for (int i = 0; i < 5; i++) {

			if (grade[i] < 40)
				grade[i] = 40;

			sum += grade[i];

		}
		
		cout << sum / 5 << "\n";

	}

	return 0;

}

C++: #include<stdio.h>

int main(){
  int a, b, c, d, e, ave;
  scanf("%d %d %d %d %d", &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;
  }
  ave = (a + b + c + d + e) / 5;
  printf("%d\n", ave);
  return 0;
}

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

int main() {
    int sum = 0;

    for (int i=0; i<5; i++) {
        int score;
        scanf("%d", &score);
        if (score < 40) score = 40;
        sum += score;
    }

    printf("%d\n", sum/5);
}