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>
#include <stdio.h>
using namespace std;
int average(int a,int b,int c,int d,int e){
	return (a+b+c+d+e)/5;
}
int main() {
	int i=0;
	int stu[5];
	int heikin;
	while(i<5){
		scanf("%d", &stu[i]);
		stu[i] = max(40, stu[i]);
		i++;
	}
	heikin = average(stu[0], stu[1], stu[2], stu[3], stu[4]);
	printf("%d\n", heikin);
	return 0;
}

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

using namespace std;

int main()
{
	int score, sum = 0;

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

		sum += max(score, 40);
	}

	cout << sum / 5 << endl;

	return 0;
}

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

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

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

  cout << sum/5 << endl;
}

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

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

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

using namespace std;

int main(){
	int sum = 0, x;
	while (cin >> x) sum += min(40, x);
	cout << sum / 5 << endl;

	return 0;
}

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

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

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

int main() {
	int tensu[5], tasu = 0;

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

	cout << tasu / 5;

}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<long long, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<long long, long long> ll_ll;
typedef pair<double, double> d_d;
typedef vector<int> Vint;

#define PI 3.141592653589793238462643383279
#define mod 1000000007LL
#define rep(i, n) for(i = 0;i < n;++i)
#define rep1(i, n) for(i = 1;i < n;++i)
#define rep2d(i, j, n) for(i = 0;i < n;++i)for(j = i + 1;j < n;++j)
#define per(i, n) for(i = n - 1;i > -1;--i)
#define int(x) int x; scanf("%d",&x)
#define int2(x, y) int x, y; scanf("%d%d",&x, &y)
#define int3(x, y, z) int x, y, z; scanf("%d%d%d",&x, &y, &z)
#define int4(v, x, y, z) int v, x, y, z; scanf("%d%d%d%d", &v, &x, &y, &z)
#define int5(v, w, x, y, z) int v, w, x, y, z; scanf("%d%d%d%d%d", &v, &w, &x, &y, &z)
#define scn(n, a) rep(i, n)cin >> a[i]
#define sc2n(n, a, b) rep(i, n)cin >> a[i] >> b[i]
#define pri(x) cout << x << "\n"
#define pri2(x, y) cout << x << " " << y << "\n"
#define pri3(x, y, z) cout << x << " " << y << " " << z << "\n"
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define endl "\n"
#define kabe puts("---------------------------")
#define kara puts("")
#define debug(x) cout << " --- " << x << "\n"
#define debug2(x, y) cout << " --- " << x << " " << y << "\n"
#define debug3(x, y, z) cout << " --- " << x << " " << y << " " << z << "\n"
#define X first
#define Y second
#define eps 0.0001
#define prid(x) printf("%.15lf\n", x)


signed main(void){
  int i, j, k;
  for(int testcase = 0;testcase >= 0;testcase++){
    int5(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;
    pri((a + b + c + d + e) / 5);

/*/

//*/ break;
  }
  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 a,b,c,d,e,f;
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;
}
f=(a+b+c+d+e)/5;
cout<<f<<'\n';
return 0;
}

C++: #include <stdio.h>
#include <iostream>
#include <algorithm>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <math.h>
#include <cstdio>
#include <float.h>
#include <ctype.h>
 using namespace std;
 int main(void) {
	 int a, b, c, d, e, total, avg;
	 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;
	 }
	 total = a + b + c + d + e;
	 avg = total / 5;
	 printf("%d\n", avg);
	 return 0;
 }

C++: // AOJ 0592
#include<cstdio>
#define rep(i,a) for( int i = 0; i != (a); ++i )

int main()
{
	int sum = 0;
	rep( i, 5 )
	{
		int a;
		scanf( "%d", &a );
		sum += a >= 40 ? a : 40;
	}

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

	return 0;
}

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

using namespace std;


int main(void){

	int ans = 0;
	for( int i = 0; i < 5; i++ ) {
		int n;
		cin >> n;
		if( n < 40 ) ans += 40;
		else ans += n;
	}
	cout << ans / 5 << endl;

    return 0;
}

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

int main()
{
    int a; int b; int c; int d; int e;
    cin>>a>>b>>c>>d<<e;
   if(a<40){
       a==40
       }else{
       a==a
       }
   if(b<40){
       b==40
       }else{
       b==b
       }
   if(c<40){
       c==40
       }else{
       c==c
       }
   if(d<40){
       d==40
       }else{
       d==d
       }
    if(d<40){
       d==40
       }else{
       d==d
       }
  cout << (a+b+c+d+e)/5 << endl;
}

C++: #include<iostream>
using namespace std;
int main () {
	int sum = 0;
	int p;
	for (int i=0; i<5; i++) {
		cin >> p;
		if(p < 40) { p = 40; }
		sum += p;
	}
	cout << sum / 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;
}