提交时间:2019-12-13 20:09:30

运行 ID: 3081

#include<iostream> using namespace std; int main(){ double qqq=0,www=0,eee=0,rrr=0; int ey,youku[111]; cin>>ey; for(int E=1;E<=ey;E++){ cin>>youku[E]; } for(int x=1;x<=ey;x++){ if(youku[x]>=0&&youku[x]<=18){ qqq++; }else{ if(youku[x]>=19&&youku[x]<=35){ www++; }else{ if(youku[x]>=36&&youku[x]<=60){ eee++; }else{ rrr++; } } } } qqq*=100/ey; www*=100/ey; eee*=100/ey; rrr*=100/ey; printf("%.2lf%%\n%.2lf%%\n%.2lf%%\n%.2lf%%",qqq,www,eee,rrr); return 0; }