1 条题解
-
0
#include<bits/stdc++.h> using namespace std; int main(){ double n,a,b,c,d,e; cin>>n; for(int i=0;i<n;i++){ cin>>e; if(e>=0&&e<=18) a++; if(e>=19&&e<=35) b++; if(e>=36&&e<=60) c++; if(e>=61)d++; } cout<<fixed<<setprecision(2)<<a/n*100<<"%"<<endl; cout<<fixed<<setprecision(2)<<b/n*100<<"%"<<endl; cout<<fixed<<setprecision(2)<<c/n*100<<"%"<<endl; cout<<fixed<<setprecision(2)<<d/n*100<<"%"<<endl; return 0; }
- 1
信息
- ID
- 110
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 5
- 标签
- 递交数
- 190
- 已通过
- 73
- 上传者