Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextInt() int {
	n, err := strconv.Atoi(nextString())
	if err != nil {
		fmt.Printf("strconv.Atoi failed: %v\n", err)
	}
	return n
}

func main() {
	scanner.Split(bufio.ScanWords)
	sum := 0
	for i := 0; i < 5; i++ {
		score := nextInt()
		if score < 40 {
			sum += 40
		} else {
			sum += score
		}
	}
	// fmt.Println(sum)
	fmt.Println(sum / 5)
}

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