[Network] cattle off cattle off the winter training camp 2-- basic algorithm Virgo and Chong Xiufei

Links: https://ac.nowcoder.com/acm/contest/327/D
Source: Cattle-off network
 

Time limit: C / C ++ 1 second, 2 seconds languages other
space restrictions: C / C ++ 262144K, other languages 524288K
64bit the IO the Format: LLD%

Title Description

Final exam is over, Virgo found that many people were hung up big, can only wait for the second year of rehabilitation, must pay $ 400 Zhongxiu Fei. Virgo suddenly remembered there and he talked about seniors, what if the school year short of money, the year of the big things the papers would be particularly difficult. Virgo now have all the results, Virgo wondering if all the people hanging branches were rebuilt in the second year, the number of Chong Xiufei school earn?

It refers to a course hanging branches score less than 60 points.

Enter a description:

第一行一个整数n,表示考试的人数。
第二行n个整数,表示每个人的成绩。
1<=n<=10000
学生的成绩为0-100(包括0和100)之间的整数

Output Description:

一行,学校能赚的重修费用

Example 1

Entry

4
60
56
100
59

Export

800

Solution: attendance problem.

AC Code:

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,ans=0;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		int k;
		cin>>k;
		if(k<60)
			ans+=400;
	}
	cout<<ans<<endl;
	return 0;
}

 

Published 119 original articles · won praise 20 · views 60000 +

Guess you like

Origin blog.csdn.net/qq_40727946/article/details/86634317