当前位置:网站首页>Blue Bridge Cup real question: score statistics
Blue Bridge Cup real question: score statistics
2022-07-01 18:22:00 【lsgoose】
Title Description
Xiao Lan organized a test for the students , The total score of the roll is 100 branch , Every student scores 0 To 100 The integer of .
If the score is at least 60 branch , Is called a pass . If the score is at least 85 branch , Is called excellent .
Please calculate the pass rate and excellent rate , In percentage , The part before the percent sign is rounded to the nearest whole number Count .
Input description
The first line of input contains an integer n\ (1 \leq n \leq 10^4)n (1≤n≤104), It means the number of examinees .
Next nn That's ok , Each line contains a 0 to 100 The integer of , A student's score .
Output description
Output two lines , One percentage per line , They represent the passing rate and excellent rate respectively . The part before the percent sign Round to keep the whole number .
I/o sample
Example
Input
7
80
92
56
74
88
100
0
Output
71%
43%
Operation limit
- Maximum operation time :1s
- Maximum running memory : 256M
#include <iostream>
using namespace std;
int main()
{
// Please enter your code here
int totalNum;
cin>>totalNum;
int grade;
int notFail=0,good=0;
for(int i=0;i<totalNum;++i)
{
cin>>grade;
if(grade>=60)
{
notFail++;
}
if(grade>=85)
{
good++;
}
}
int a=notFail*100.0/totalNum*1.0+0.5;
int b=good*100.0/totalNum*1.0+0.5;
printf("%d%\n",a);
printf("%d%\n",b);
return 0;
}details :
1. Rounding method
2.85 So is the above 60 The above , Don't use it. else if Exclude
边栏推荐
- Mysql database design
- An example of data analysis of an old swatch and an old hard disk disassembly and assembly combined with the sensor of an electromagnetic press
- Nearly 60% of the employees strongly support Ctrip's "3+2" working mode, and work at home for two days a week
- From comedians to NBA Zhan Huang, check the encrypted advertisements during this super bowl
- Htt [ripro network disk link detection plug-in] currently supports four common network disks
- Can hero sports go public against the wind?
- New 95 community system whole station source code
- What is web application security testing technology?
- 传感器尺寸、像素、DPI分辨率、英寸、毫米的关系
- Check log4j problems using stain analysis
猜你喜欢

Set the style of QT property sheet control

Penetration practice vulnhub range Nemesis

2022 Heilongjiang latest fire protection facility operator simulation test question bank and answers

Cassette helicopter and alternating electric field magnetic manometer DPC

Domestic spot silver should be understood

The difference and relationship between iteratible objects, iterators and generators

Intel's open source deep learning tool library openvino will increase cooperation with local software and hardware parties and continue to open

Penetration practice vulnhub range Keyring

Mysql database design

LeetCode 148. Sort linked list
随机推荐
Zabbix报警执行远程命令
How to learn automated testing?
Function, condition, regular expression
Common design parameters of solid rocket motor
手机开户股票开户安全吗?那么开户需要带些什么?
How to retrieve the password for opening Excel files
Nielseniq found that 60% of the re launched products had poor returns
Blackwich: the roadmap of decarbonization is the first step to realize the equitable energy transformation in Asia
Source code of new campus errand / campus task platform on mutual station
[2. Basics of Delphi grammar] 4 Object Pascal operators and expressions
Oracle TRUNC function processing date format
February 16, 2022 Daily: graph neural network self training method under distribution and migration
Extract the compressed package file and retrieve the password
Nearly 60% of the employees strongly support Ctrip's "3+2" working mode, and work at home for two days a week
Work and leisure suggestions of old programmers
Glidefast consulting was selected as the elite partner of servicenow in 2022
. Net cloud native architect training camp (permission system code implements actionaccess) -- learning notes
Product service, operation characteristics
2022 Heilongjiang latest fire protection facility operator simulation test question bank and answers
When the fixed frequency artifact falls in love with multithreading | ros2 fixed frequency topic release demo