提交时间:2019-12-07 16:43:36

运行 ID: 2884

#include<iostream> using namespace std; int main(){ short a,b[100],i; float c=0,d=0,e=0,f=0; cin>>a; for(i=0;i<a;i++) cin>>b[i]; for(i=0;i<a;i++){ if(b[i]<=18) c=c+100.0/a; else if(b[i]<=36) d=d+100.0/a; else if(b[i]<=60) e=e+100.0/a; else f=f+100.0/a; } printf("%.2f%\n%.2f%\n%.2f%\n%.2f%\n",c,d,e,f); }