题解:
本题直接用及格和优秀人数分别除以总人数即可
package 练习;
import java.util.Scanner;
public class 蓝桥测试 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
//在此输入您的代码...
int renshu=scan.nextInt();
int jige=0;
int youxiu=0;
int[] fenshu =new int[renshu];
for(int i=0;i<renshu;i++)
{
fenshu[i]=scan.nextInt();
if(fenshu[i]>=60)
{
jige++;
}
if(fenshu[i]>=85)
{
youxiu++;
}
}
//这里用Math.round函数,即四舍五入函数,取几位就乘以几百
int ll= (int) Math.round(((double)jige/renshu)*100);
int kk=(int) Math.round(((double)youxiu/renshu)*100);
System.out.println(ll+"%");
System.out.print(kk+"%");
scan.close();
}
}