提交时间:2019-12-10 20:49:52
运行 ID: 3025
#include<iostream> using namespace std; int main(){ int a[100],b; double ai=0,bi=0,ci=0,di=0; cin>>b; for(int i=1;i<=b;i++){ cin>>a[i]; if(a[i]>=0&&a[i]<=18) ai++; if(a[i]>=19&&a[i]<=35) bi++; if(a[i]>=36&&a[i]<=60) ci++; if(a[i]>=61) di++; } ai=ai/b*100; bi=bi/b*100; ci=ci/b*100; di=di/b*100; printf("%.2lf%%\n",ai); printf("%.2lf%%\n",bi); printf("%.2lf%%\n",ci); printf("%.2lf%%\n",di); }