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

typedef long long ll;
typedef pair<int, int> P;
#define MOD 1000000007
#define INF (1 << 30)
#define REP(i, m, n) for(int i = (int)m; i < (int)n; ++i)
#define rep(i, n) REP(i, 0, n)


signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int sum = 0;
    rep(i, 5) {
        int a; cin >> a;
        a = max(a, 40);
        sum += a;
    }
    cout << sum/5 << '\n';
    return 0;
}

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

C++: #include <iostream>
#include <cstdio>
#include <map>
#include <string>

using namespace std;

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

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

using std::cin;
using std::cout;
using std::endl;
using std::array;
using std::for_each;
using std::accumulate;

int main() {
	array<int,5> score;
	for_each(score.begin(),score.end(),[](int &s){
		cin >> s;
		if (s < 40) {
			s = 40;
		}
	});
	cout << accumulate(score.begin(),score.end(),0)/5 << endl;
}

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

#define times(n, i)      uptil(0, n, i)
#define upto(f, t, i)    for(decltype(t) _##i = (t), i = (f); i <= _##i; i++)
#define uptil(f, t, i)   for(decltype(t) _##i = (t), i = (f); i < _##i; i++)
#define downto(f, t, i)  for(decltype(t) _##i = (t), i = (f); i >= _##i; i--)
#define downtil(f, t, i) for(decltype(t) _##i = (t), i = (f); i > _##i; i--)
#define unless(c) if(!(c))
#define until(c) while(!(c))
#define loop while(true)

#define all(v) v.begin(), v.end()
#define ln << "\n"

struct line{};

template<class T> istream& operator>>(istream& in, vector<T>& v) {
    times(v.capacity(), i) in >> v[i];
    return in;
}

template<class T> const ostream& operator<<(ostream& out, const vector<T>& v) {
    times(v.size(), i) out << (i ? " " : "") << v[i];
    return out;
}

template<class T, class...U> typename enable_if<is_same<T, line>::value, string>::type next(istream& in, const U&... args) {
    string s;
    getline(in, s, args...);
    return move(s);
}

template<class T, class...U> typename enable_if<!is_same<T, line>::value, T>::type next(istream& in, const U&... args) {
    T t(args...);
    in >> t;
    return move(t);
}
template<class T, class...U> auto next(const U&... args) -> decltype(next<T>(cin)) {
    return next<T>(cin, args...);
}

template<class T> T sum(const vector<T>& v) {
    T ans = T();
    for(const T& t : v) ans += t;
    return ans;
}

template<class T> T sum(const typename vector<T>::iterator& begin, const typename vector<T>::iterator& end) {
    T ans = T();
    for(typename vector<T>::iterator t = begin; t != end; t++) ans += *t;
    return ans;
}

template<class T> T min(const vector<T>& v) {
    return *min_element(v.begin(), v.end());
}

template<class T> T min(const typename vector<T>::iterator& begin, const typename vector<T>::iterator& end) {
    return *min_element(begin, end);
}

template<class T> T max(const vector<T>& v) {
    return *max_element(v.begin(), v.end());
}

template<class T> T max(const typename vector<T>::iterator& begin, const typename vector<T>::iterator& end) {
    return *max_element(begin, end);
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    auto P = next<vector<int>>(5);
    for(int& p : P) if(p < 40) p = 40;
    cout << sum(P) / P.size() ln;

    return 0;
}

C++: #include <iostream>

using namespace std;

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

C++: #include <iostream>

using namespace std;

int main(){
    int s=0;
    int n=5;
    while(n--){
        int t; cin>>t;
        s+=max(t,40);
    }
    cout<<s/5<<endl;
}

C++: #include<iostream>
#include<stdio.h>
#include<algorithm>
using namespace std;
int main()
{
	int a, g = 0, h, i;
	for (i = 0; i < 5; i++)
	{
		cin >> a;
		if (a < 40)
			a = 40;
		g += a;
	}
	h = g / 5;
	cout << h << endl;
	return 0;
}

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

int main()
{

	int SumScore, Score;

	SumScore = 0;

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

		if( Score >= 40 ) SumScore += Score;
		else			  SumScore += 40;

	}

	cout << SumScore / 5 << endl;

	return 0;

}

C++: #include<iostream>
using namespace std;
int main(i){
int s[2]={0};
for(;i<6;i++){cin >> s[0];
s[1] += s[0]>39?s[0]:40;
}
cout << s[1]/5 << endl;
return 0;
}

C++: #include <iostream>

void solve() {
    int sum = 0;
    for (int i = 0; i < 5; ++i) {
        int x;
        std::cin >> x;
        sum += std::max(x, 40);
    }
    std::cout << sum / 5 << std::endl;
}

int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);

    solve();

    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
  int sum=0;
  int a;
  for(int i=0; i<5; i++){
    cin >> a ;
    if(a<40){
      sum+=40;
    }else{
      sum+=a;
    }
  }
  cout << sum/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<stdio.h>
int main()
{
	int a,i,r;
	for(i=0;i<5;i++){
		scanf("%d",&a);
		if(a<40){
			a=40;
		}
		r+=a;
	}
	printf("%d\n",r/5);
	return 0;
}

C++: #include<iostream>
using namespace std;int main(){int a,sum=0;for(int i=0;i<5;i++){cin>>a;if(a<40)a=40;sum+=a/5;}cout<<sum<<"\n";return 0;}

C++: #include <cstdio>

#define N	5

int main()
{
	int sum = 0;
	for (int i = 0; i < N; i++)
	{
		int pts;

		::scanf("%i", &pts);

		sum += (pts < 40 ? 40 : pts);
	}

	::printf("%i\n", sum / N);
}

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

C++: #include <iostream>

using namespace std;

int main(void){

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

  return 0;
}

C++: #include <cstdio>

using namespace std;

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

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

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

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

    cout << sum / 5 << endl;
}

C++: #include  <iostream>

using namespace std;

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

C++: // 2014/01/28 Tazoe

#include <iostream>
using namespace std;

int main()
{
	int sum = 0;

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

		if(s>=40){
			sum += s;
		}
		else{
			sum += 40;
		}
	}

	cout << sum/5 << endl;

	return 0;
}

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