当前位置:网站首页>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
边栏推荐
- Definition of rotation axis in mujoco
- Unity3d extended toolbar
- (6) VIM editor MV cat redirection standard input and output more pipe symbols head tail
- Fresh, 2022 advanced Android interview must know 100 questions (interview questions + answer analysis)
- Develop those things: add playback address authentication to easycvr platform
- At present, where is the most formal and safe account opening for futures speculation? How to open a futures account?
- Redis master-slave realizes 10 second check and recovery
- Fix the problem that easycvr device video cannot be played
- Rotation order and universal lock of unity panel
- Cloud picture says | distributed transaction management DTM: the little helper behind "buy buy buy"
猜你喜欢

Fix the black screen caused by iPhone system failure

Data query language (DQL)

Android development interview was badly hit in 3 years, and now the recruitment technical requirements are so high?
![[PHP foundation] realize the connection between PHP and SQL database](/img/eb/c8953eddfe3b19b0adb5529957d275.jpg)
[PHP foundation] realize the connection between PHP and SQL database

Bug of QQ browser article comment: the commentator is wrong

Work and leisure suggestions of old programmers

Classpath classpath

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

Kernel stray cat stray dog pet adoption platform H5 source code

Common design parameters of solid rocket motor
随机推荐
JS how to convert a string with a delimiter into an n-dimensional array
Sword finger offer II 105 Maximum area of the island
ArrayList扩容详解
Mujoco XML modeling
ACM mm 2022 video understanding challenge video classification track champion autox team technology sharing
开发那些事儿:EasyCVR平台添加播放地址鉴权
Draw drawing process of UI drawing process
Equipment simulation and deduction training system software
Talk about the favorite tools used by project managers
Definition of rotation axis in mujoco
transform. Forward and vector3 Differences in the use of forward
聊聊项目经理最爱使用的工具
Penetration practice vulnhub range Keyring
【Try to Hack】vulnhub DC4
Convert the robot's URDF file to mujoco model
t10_ Adapting to Market Participantsand Conditions
MySQL -- explain performance optimization
Batch export all pictures in PPT in one second
Record 3 - the state machine realizes key control and measures the number of external pulses
(6) VIM editor MV cat redirection standard input and output more pipe symbols head tail