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 <stdio.h>

int score[5], ans = 0;

int main(void) {
	scanf("%d%d%d%d%d", &score[0], &score[1], &score[2], &score[3], &score[4]);
	
	for (int i = 0; i < 5; ++i) {
		if (score[i] < 40) { ans += 40; }
		else { ans += score[i]; }
	}

	printf("%d\n", ans / 5);
	return 0;
}

C++: #include <iostream>

using namespace std;

int main(){
	int student[5], total;

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

	cout << total / 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;
}

C++: #include<iostream>
using namespace std;
int main() {
	int num[5], sum=0;
	for (int i = 0; i < 5; i++) {
		cin >> num[i];
		if (num[i] < 40) num[i] = 40;
		sum = sum + num[i];
	}
	cout << sum / 5 << endl;
	return 0;
}

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

int main(){
  int a[5];
  int ave = 0;

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

    ave += a[i];
  }

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

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

using namespace std;

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

	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <array>
#include <vector>

using namespace std;

int main() {

  int sum = 0;
  for ( int i = 0; i < 5; i++ ){
	int val;
	cin >> val;
	if ( val >= 40 ) {
	  sum += val;
	} else {
	  sum += 40;
	}
  }
  cout << ( sum / 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;



return 0;
}

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

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

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

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

C++: #include<stdio.h>
int main(void)
{
	int a,b,c,d,e,x,y;
	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;
	}
	x=a+b+c+d+e;
	y=x/5;
	printf("%d\n",y);
	return 0;
}

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

C++: #include<stdio.h>

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

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

int a[5];
int sum = 0;
int ave = 0;

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

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

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

C++: #include<stdio.h>

int average(int a[])
{
  int i,sum=0;
  for(i=0;i<5;i++){
    if(a[i]<40){
      a[i]=40;
    }
    sum=sum+a[i];
  }
  return(sum/5);
}

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

  s=average(a);
  printf("%d\n",s);
  return(0);
}

C++: /*期末試験を実施した．期末試験は，5 人全員が受験した．期末試験の点数が 40 点以上の生徒は，期末試験の点数がそのまま成績になった．期末試験の点数が 40 点未満の生徒は全員，補習を受け，成績が 40 点になった． 
5 人の生徒の期末試験の点数が与えられたとき，5 人の成績の平均点を計算するプログラムを作成せよ．*/
#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<stdio.h>
#include<iostream>

using namespace std;

int main(){

	int a[5];

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

		if(a[i]<=40)sum+=40;
		else sum += a[i];

	}

	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);
	if(a<=40){
		a=40;
	}
	if(b<=40){
		b=40;
	}
	if(c<=40){
		c=40;
	}
	if(d<=40){
		d=40;
	}
	if(f<=40){
		f=40;
	}
	x=(a+b+c+d+f)/5;
	printf("%d\n",x);
	return 0;
}

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

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

    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;

	int answer;
	if (A < 0){
		answer = -A * C + D + B * E;
	}

	if (A > 0){
		answer = (B -A) * E;
	}

	cout << answer << endl;


		

}*/

#include <iostream>
using namespace std;
int main(){
	
	int A,B,C,D,E;
	cin >> A >> B >> C >> D >> E;

	int answer= 0;
	if (40 <= A){
		answer = answer+A;
	}

	if (40 > A ){
		answer = answer + 40;
	}

	if (40 <= B){
		answer = answer+B;
	}

	if (40 > B){
		answer = answer + 40;
	}

	if (40 <= C){
		answer = answer+C;
	}

	if (40 > C){
		answer = answer + 40;
	}
	
	if (40 <= D){
		answer = answer+D;
	}

	if (40 > D){
		answer = answer + 40;
	}

	if (40 <= E){
		answer = answer+E;
	}

	if (40 > E){
		answer = answer + 40;
	}


	cout << answer/5 << endl;


}

C++:  //JOI13-quest1.cpp  Defines the entry point for the console application.

#include <stdio.h>

int main(void)
{
	int temp, sum = 0;
	for (int i = 0; i  5; i++) {
		scanf("%d", &temp);

		if (temp = 40) {
			sum += temp;
		}
		else {
			sum += 40;
		}
	}

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

	return 0;
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
#define rep(i,a) for(int i = 0 ; i < a; i ++)
int main(void){
  int sum = 0;
  rep(i,5){
    int in;
    cin>>in;
    if(in<=40)sum += 40;
    else sum += in;
  }
  cout<<sum / 5 << endl;
  return 0;
}

C++: #include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int main() {
	int a[10];
	int sum = 0;
	for (int i = 0; i < 5; i++) {
		cin >> a[i];
		if (a[i] < 40)a[i] = 40;
		sum += a[i];
	}
	cout << sum/5 << endl;
}

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

int main() {
    int sum = 0;
    for(int i = 0; i < 5; ++i) {
        int a; cin >> a;
        sum += max(40, 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);
	if(a<=40){
		a=40;
	}
	if(b<=40){
		b=40;
	}
	if(c<=40){
		c=40;
	}
	if(d<=40){
		d=40;
	}
	if(f<=40){
		f=40;
	}
	x=(a+b+c+d+f)/5;
	printf("%d\n",x);
	return 0;
}

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