当前位置:网站首页>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
边栏推荐
- Pytorch crossentropyloss learning
- 540. Single element in ordered array
- Apk signature process introduction [easy to understand]
- The method of real-time tracking the current price of London Silver
- Is it safe to open a stock account by mobile phone? What do you need to bring with you to open an account?
- Countdownlatch blocking wait for multithreading concurrency
- js如何将带有分割符的字符串转化成一个n维数组
- Bug of QQ browser article comment: the commentator is wrong
- Is it safe to open a securities account? Is there any danger
- The latest software scheme of the intelligent information management system of the armed police force
猜你喜欢
Set the style of QT property sheet control
Yuancosmos game farmersworld farmers world - core content of the second conference in China!
Classpath classpath
Domestic spot silver should be understood
Technical secrets of ByteDance data platform: implementation and optimization of complex query based on Clickhouse
SQL injection vulnerability (MySQL and MSSQL features)
Review Net 20th anniversary development and 51aspx growth
Data warehouse (3) star model and dimension modeling of data warehouse modeling
[C supplement] [string] display the schedule of a month by date
Highly reliable program storage and startup control system based on anti fuse FPGA and QSPI flash
随机推荐
Explain in detail the process of realizing Chinese text classification by CNN
2022 Heilongjiang latest fire protection facility operator simulation test question bank and answers
Review Net 20th anniversary development and 51aspx growth
ArrayList扩容详解
t10_ Adapting to Market Participantsand Conditions
SQL injection vulnerability (MySQL and MSSQL features)
The latest intelligent factory MES management system software solution
SLO is increasingly used to achieve observability | Devops
When the fixed frequency artifact falls in love with multithreading | ros2 fixed frequency topic release demo
APK签名流程介绍[通俗易懂]
At present, where is the most formal and safe account opening for futures speculation? How to open a futures account?
MES production equipment manufacturing execution system software
Technical secrets of ByteDance data platform: implementation and optimization of complex query based on Clickhouse
Kia recalls some K3 new energy with potential safety hazards
期货先锋这个软件正规吗安全吗?选择哪家期货公司更安全?
The method of real-time tracking the current price of London Silver
About selenium element positioning being overwritten
February 16, 2022 Daily: graph neural network self training method under distribution and migration
[C supplement] [string] display the schedule of a month by date
Convert the robot's URDF file to mujoco model