当前位置:网站首页>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
边栏推荐
- Terms related to K line
- Vue uses keep alive to cache page optimization projects
- Mujoco model learning record
- Single element of an ordered array
- ACL 2022 | decomposed meta learning small sample named entity recognition
- SCP -i private key usage
- Zabbix报警执行远程命令
- How to learn automated testing?
- Sword finger offer II 105 Maximum area of the island
- 期货账户的资金安全吗?怎么开户?
猜你喜欢

ISO 27001 Information Security Management System Certification

Classpath classpath

Common design parameters of solid rocket motor

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

Set the style of QT property sheet control

Nearly 60% of the employees strongly support Ctrip's "3+2" working mode, and work at home for two days a week

Heavy disclosure! Hundreds of important information systems have been invaded, and the host has become a key attack target

Penetration practice vulnhub range Nemesis

Cloud computing - make learning easier

Data query language (DQL)
随机推荐
Cloud computing - make learning easier
Source code of new campus errand / campus task platform on mutual station
Redis -- data type and operation
Draw drawing process of UI drawing process
目前炒期货在哪里开户最正规安全?怎么期货开户?
Explain in detail the process of realizing Chinese text classification by CNN
期货先锋这个软件正规吗安全吗?选择哪家期货公司更安全?
Pytorch crossentropyloss learning
Highly reliable program storage and startup control system based on anti fuse FPGA and QSPI flash
Length of learning and changing
Leetcode 1380. Lucky numbers in the matrix (save the minimum number of each row and the maximum number of each column)
Htt [ripro network disk link detection plug-in] currently supports four common network disks
[beauty detection artifact] come on, please show your unique skill (is this beauty worthy of the audience?)
股票万1免5证券开户是合理安全的吗,怎么讲
(6) VIM editor MV cat redirection standard input and output more pipe symbols head tail
2022 Heilongjiang latest fire protection facility operator simulation test question bank and answers
MySQL + JSON = King fried
Yuancosmos game farmersworld farmers world - core content of the second conference in China!
Growing up in the competition -- (Guangyou's most handsome cub) Pikachu walking
. Net cloud native architect training camp (permission system code implements actionaccess) -- learning notes