关于double的printf输出格式
在c语言中,double类型的读入必须用"%lf"
;输出必须用"%f"
详情见第2条
题解
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,a=0,b=0,d,k;
double e;
cin>>n>>e>>d;
for(int i=0;i<n;i++){
int cnt=0;
double tmp;
cin>>k;
for(int j=0;j<k;j++){
cin>>tmp;
if(tmp<e){
cnt++;
}
}
if(cnt>k/2&&k>d){
b++;
}else if(cnt>k/2&&k<=d){
a++;
}
}
printf("%.1f%% %.1f%%\n",a*100.0/n,b*100.0/n);
return 0;
}