Go: package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sum := 0.0
	for i := 0; i < 5; i++ {
		sc.Scan()
		s, _ := strconv.Atoi(sc.Text())
		sum += math.Max(float64(s), float64(40))
	}
	fmt.Println(int(sum / 5))

}

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

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;
		if (a < 40)
		{
			a = 0;
			a = 40;
		}
		con += a;
	}

	cout << con / 5 << endl;
}

C++: #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
int main() {
	int ans = 0;
	for (int i = 0; i < 5; i++) {
		int x; cin >> x;
		ans += max(x, 40);
	}
	cout << ans / 5 << endl;
}

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

C++: #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;
return 0;
}

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

int main() {
	int sum=0;
	int item;
	while(cin>>item){
		if(item<=40)item=40;
		sum+=item/5;
	}
	cout<<sum<<endl;
	return 0;
}

C++: #include<bits/stdc++.h>
int a,s,i;main(){for(i=0;i<5;i++){std::cin>>a;s+=max(40,a);}printf("%d\n",s/5);}

C++: #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define enld '\n'
#define rep(i,n) for(int i=0; i<(n); i++)
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("Ofast")
constexpr ll INF = 1e18;
constexpr int inf = 1e9;
constexpr ll mod = 1000000007;
constexpr ll mod2 = 998244353;
const double PI = 3.1415926535897932384626433832795028841971;
const int dx[6] = {1, 0, -1, 0,1,1};
const int dy[6] = {0, 1, 0, -1,1,-1};
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; }
// ---------------------------------------------------------------------------

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int sum = 0;
    for(int i=0; i<5; i++){
        int a;
        cin >> a;
        sum += max(a,40);
    }
    cout << sum/5 <<enld;
    return 0;
}

C++: #include <iostream>

using namespace std;

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

C++: #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;
	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 << endl;
}

C++: #include<stdio.h>
int main(void)
{
	int a,b,c,d,e,f,x;
	scanf("%d %d %d %d %d",&a,&b,&c,&d,&f);
	x=(a+b+c+d+f)/5;
	printf("%d\n",x);
	return 0;
}

C++: #include<iostream>
using namespace std;
int t;
int j;
int s;
int h;
int n;
int main(){
	cin >> t;
	cin >> j;
	cin >> s;
	cin >> h;
	cin >> n;
	if (t < 40){
		t = 40;
	}
	if (j < 40){
		j = 40;
	}
	if (s < 40){
		s = 40;
	}
	if (h < 40){
		h = 40;
	}
	if (n < 40){
		n = 40;
	}
	cout << (t + j + s + h + n) / 5 << endl;

	return 0;
}

C++: #include<cstdio>
using namespace std;
int main(void)
{
	int a[5],gou,hei,i;
	gou=0;
	for(i=0;i<5;i++){
		scanf("%d",&a[i]);
		if(a[i]<40){
			a[i]=40;
		}
		gou+=a[i];
	}
	hei=gou/5;
	printf("%d\n",hei);
	return 0;
}

C++: #include<cstdio>

int main(void){
	int p, buf, i;
	scanf("%d", &p); p=(p<40)?40:p;
	for(i=0; i<4; ++i){ scanf("%d", &buf); p+=(buf<40)?40:buf; }
	printf("%d\n", p/5);
	return(0);
}

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

int main()
{
	int sum = 0;
	for(int i = 0; i < 5; i++) {
		int p;
		cin >> p;
		sum += max(p, 40);
	}

	cout << sum / 5 << endl;
}

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;
sum += a;
}
cout << sum/5 << "\n";
return 0;
}

C++: #include<stdio.h>
int main()
{
	int a, b = 0, i;
	for (i = 0; i < 5; i++){
		scanf("%d", &a);
		b+=a;
	}
	printf("%d\n", b/5);
	return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;

int main() {
        int N =5;
        vector<int>             v(N);

        rep(i, N) {
                cin >> v.at(i);
                if (v.at(i) < 40) v.at(i) = 40;
        }

        int sum = accumulate(v.begin(), v.end(), 0);
        cout << sum / v.size() << endl;
        return 0;
}

C++: #include<iostream>
using namespace std;
int a[5];
int result;

int main(){
	for(int n = 0;n<5;n++){
		cin >> a[n];
		if(a[n] < 40)a[n] = 40;
		result += a[n];
	}
	cout << result/5 << endl;
}

C++: #include <stdio.h>

int main(void) {
    int i, a;
    int s = 0;
    for (i = 0; i < 5; i++) {
        scanf("%d", &a);
        if (a < 40)
            s += 40;
        else
            s += a;
    }

    printf("%d", s / 5);
}