C++ 代码
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
int n,s1=0,s2=0,temp;
cin >> n;
for(int i=0; i<n; i++){
scanf("%d",&temp);
if(temp>=85){
s1++;
s2++;
}else if(temp>=60){
s1++;
}
}
double d1,d2;
d1 = s1*1.0/n;
d2 = s2*1.0/n;
s1 = int(d1*100 + 0.5);
s2 = int(d2*100 + 0.5) ;
cout<< s1 << "%" <<endl;
cout<< s2 << "%" <<endl;
}