#include <ios>
#include <iostream>
using namespace std;
#include <iomanip>
int main() {
double res = 0.0;
int cntP = 0;
int cnt = 0;
int a;
while(cin >> a){
if(a > 0){
res += a;
cntP++;
}else{
cnt++;
}
}
if(cntP!=0){
res = res/cntP;
}
cout << cnt << endl;
cout <<setprecision(1)<<fixed <<res << endl;
}
// 64 位输出请用 printf("%lld")
要注意计数为0的情况和一位小数输出
fixed的加入才会输出0.0

京公网安备 11010502036488号