提交时间:2019-12-12 21:44:32
运行 ID: 3049
#include<iostream> using namespace std; int main(){ int ill[101],sum; double age[5]={0}; cin>>sum; for(int i=1;i<=sum;i++){ cin>>ill[i]; if(ill[i]<=18&&ill[i]>=0){ age[1]++; } if(ill[i]<=35&&ill[i]>18){ age[2]++; } if(ill[i]<=60&&ill[i]>35){ age[3]++; } if(ill[i]>=61){ age[4]++; } } double bu=age[1]*10.0; double tu=age[2]*10.0; double cu=age[3]*10.0; double wu=age[4]*10.0; printf("%.2lf%%\n",bu); printf("%.2lf%%\n",tu); printf("%.2lf%%\n",cu); printf("%.2lf%%\n",wu); return 0; }