当前位置:网站首页>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
边栏推荐
- [2. Basics of Delphi grammar] 4 Object Pascal operators and expressions
- Is the software of futures pioneer formal and safe? Which futures company is safer to choose?
- . Net cloud native architect training camp (permission system code implements actionaccess) -- learning notes
- Explain in detail the process of realizing Chinese text classification by CNN
- Is Huishang futures a regular futures platform? Is it safe to open an account in Huishang futures?
- Batch export all pictures in PPT in one second
- EasyCVR设备录像出现无法播放现象的问题修复
- D @ safety and dip1000
- Easycvr accesses the equipment through the national standard gb28181 protocol. What is the reason for the automatic streaming of the equipment?
- Blackwich: the roadmap of decarbonization is the first step to realize the equitable energy transformation in Asia
猜你喜欢

PTA year of birth

Set the style of QT property sheet control

SQL injection vulnerability (MySQL and MSSQL features)

Product service, operation characteristics

ACL 2022 | decomposed meta learning small sample named entity recognition

Euler function: find the number of numbers less than or equal to N and coprime with n

ISO 27001 Information Security Management System Certification

Penetration practice vulnhub range Keyring

. Net cloud native architect training camp (permission system code implements actionaccess) -- learning notes

Fresh, 2022 advanced Android interview must know 100 questions (interview questions + answer analysis)
随机推荐
Happy new year | 202112 monthly summary
Development cost of smart factory management system software platform
Leetcode 1380. Lucky numbers in the matrix (save the minimum number of each row and the maximum number of each column)
ACM mm 2022 video understanding challenge video classification track champion autox team technology sharing
Is it reasonable and safe to open a securities account for 10000 shares free of charge? How to say
Yuancosmos game farmersworld farmers world - core content of the second conference in China!
[C supplement] [string] display the schedule of a month by date
目前炒期货在哪里开户最正规安全?怎么期货开户?
[CF559E]Gerald and Path
Cloud computing - make learning easier
PIP version problems: PIP problems still occur when installing akshare and using Tsinghua source and Douban source
Set the style of QT property sheet control
Basic usage of shell script
Setting up a time server requires the client to automatically synchronize the time of the server at 9 a.m. every day
Rotation order and universal lock of unity panel
Rust language - cargo, crates io
Can hero sports go public against the wind?
Software construction scheme of smart factory collaborative management and control application system
Develop those things: add playback address authentication to easycvr platform
Cassette helicopter and alternating electric field magnetic manometer DPC