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 <bits/stdc++.h>
using namespace std;

int main() {

  int a;
  int ans = 0;
  for(int i=0; i<5; i++) {
    cin >> a;
    if( a < 40 ) ans += 40;
    else ans += a;
  }

  cout << ans / 5 << endl;
}

C++: #include<stdio.h>
#include<algorithm>
using namespace std;
int main(){
int a,b,c,d,e;
scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);
printf("%d\n",(max(40,a)+max(40,b)+max(40,c)+max(40,d)+max(40,e))/5);
}

C++: #include<iostream>

using namespace std;


int main(void){

	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 ;

	return 0;
}

C++: #include <stdio.h>

int main(void)
{
	int i;
	int p;
	int total;
	
	total = 0;
	for (i = 0; i < 5; i++){
		scanf("%d", &p);
		if (p < 40){
			p = 40;
		}
		total += p;
	}
	printf("%d\n", total / 5);
	
	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++: #define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f

#include <iostream>
#include <cstdio>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>
  
using namespace std;
  
typedef long long ll;
typedef pair <int,int> P;
typedef pair <int,P> PP;
  
static const double EPS = 1e-8;
  
static const int tx[] = {0,1,0,-1};
static const int ty[] = {-1,0,1,0};

int main(){

  int sum = 0;
  for(int i=0;i<5;i++){
    int score;
    scanf("%d",&score);
    sum += max(40,score);
  }
  printf("%d\n",sum / 5);
}

C++: #include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
 
//const int dx[] = {1, 0, -1, 0, 1, -1, -1, 1};
//const int dy[] = {0, 1, 0, -1, 1, 1, -1, -1};
 
int main()
{
	int tmp, sum = 0;
	REP(i, 5){
		cin >> tmp;
		if (tmp < 40) sum += 40;
		else sum += tmp;
	}

	cout << sum / 5 << endl;
}

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

using namespace std;

int main(){
    int ans=0,n=5,t;
    while(n--){
        cin>>t;
        ans+=max(40,t);
    }
    cout<<ans/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;

int A = (a+b+c+d+e)/5;


cout<<A<<endl;

return 0;
}

C++: #include <iostream>

using namespace std;

int main ()
{
	int a,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 <cstdio>
#include <string>

using namespace std;

int main(void)
{	
	int score,sum = 0;
	while (cin >> score)
	{
		if (score < 40)
		{
			sum += 40;
		}
		else
		{
			sum += score;
		}
	}
	cout << sum / 5 << endl;

}

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

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

#define N 5
#define min_score 40

using namespace std;

int main()
{
  int scores[N];

  for(int i = 0; i < N; i += 1){
    cin >> scores[i];
    scores[i] = max(scores[i], min_score);
  }

  int sum = accumulate(scores, scores+N, 0);
  cout << sum << endl;

  cout << ((sum == 0)? 0 : sum/N) << 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 <algorithm>
using namespace std;

int main()
{
    int score[5];
    int sum = 0;

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

    for (int i = 0; i < 5; i++){
        if (score[i] < 40){
            score[i] = 40;
        }
        sum += score[i];
    }

    cout << sum / 5 << endl;

    return (0);
}

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

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

int main()
{
    int score[5];
    int sum = 0;

    for (int i = 0; i < 5; i++){
        cin >> score[i];
        sum += score[i];
    }

    cout << sum / 5 << endl;

    return (0);
}

C++: #include <iostream>
#include <algorithm>
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;
		}
	}
	cout << (a[1] + a[2] + a[3] + a[4] + a[5]) / 5 << endl;

	return 0;
}

C++: #include <iostream>

using namespace std;

int main ()
{
	int a,con;

	for (int i = 0; i < 5; i++)
	{
		cin >> a;
		if (a < 40)
		{
			a = 0;
			a = 40;
		}
		con += a;
	}

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

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

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

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

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

int main(){

	int a,b,c,d,e;

cin >> a >> b >> c >> d >> e;

	int m=0;

	if( a<40 ){
		m += 40;	
}
	else{
		m += a;
	}
	if( b<40 ){
		m += 40;
}
	else{
		m += b;
	}
	if( c<40 ){
		m += 40;
}
	else{
		m += c;
}
	if( d<40 ){
		m += 40;
}
	else{
		m += d;
}
	if( e<40 ){
		m += 40;
}
	else{
		m += e;}


cout << m/5 << endl;

return 0;

}

C++: // Average Score

#include <iostream>
#include <vector>

using namespace std;

int main()
{
  vector<int> exam;
  int i, x, ave = 0;

  for (i = 0; i < 5; i++) {
    cin >> x;
    exam.push_back(x);
  }

  for (i = 0; i < 5; i++) {
    if (exam[i] < 40) {
      ave += 40;
    } else {
      ave += exam[i];
    }
  }

  ave /= exam.size();

  cout << ave << endl;

  return 0;
}

C++: #include <stdio.h>

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

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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef complex<double> P;
typedef pair<int,int> pii;
#define REP(i,n) for(ll i=0;i<n;++i)
#define REPR(i,n) for(ll i=1;i<n;++i)
#define FOR(i,a,b) for(ll i=a;i<b;++i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define MOD (ll)(1e9+7)
#define ADD(a,b) a=((a)+(b))%MOD
#define FIX(a) ((a)%MOD+MOD)%MOD

int main(){
  int ret = 0;
  int t;
  REP(i,5){
    cin >> t;
    ret += t;
  }
  ret /= 5;
  cout << ret << endl;
  return 0;
}