提交时间:2019-12-09 20:57:00

运行 ID: 3008

#include<iostream> using namespace std; int main(){ float i; cin>>i; float n=0,m=0,n1=0,m1=0; int a[10000]={0}; for(int n2=0;n2<i;n2++){ cin>>a[n2]; if(a[n2]>=0&&a[n2]<=18){ n++; } if(a[n2]>=19&&a[n2]<=35){ m++; } if(a[n2]>=36&&a[n2]<=60){ n1++; } if(a[n2]>60){ m1++; } } n/=i; m/=i; n1/=i; m1/=i; n*=100; m*=100; n1*=100; m1*=100; printf("%.2f%\n%.2f%\n%.2f%\n%.2f%",n,m,n1,m1); return 0; }