#include
int main()
{
int i,tmp = 0,tot = 0;
double ans = 0;
for( i = 0 ; i < 100 ; i++)
{
scanf("%d",&tmp);
if( tmp > 0 )
{
ans += tmp;
tot++;
}
}
printf("%.2lf",ans/tot);
getch();
return 0;
}
C语言程序设计题:从键盘输入100个整数,计算并输出大于等于零的数的平均数(保留小数点后两位).
C语言程序设计题:从键盘输入100个整数,计算并输出大于等于零的数的平均数(保留小数点后两位).
其他人气:426 ℃时间:2019-12-16 03:38:27
优质解答
我来回答
类似推荐
猜你喜欢
- 1姐妹染色单体及染色体
- 2已知不等式ax²+bx+c0的解?
- 3They are going (to move) A (to) B (somewhere) C (next) D year.找错
- 4普罗米修斯课文主要内容是什么
- 5若实数x、y满足不等式组x+y≥22x−y≤4x−y≥0,则2x+3y的最小值是_.
- 6my father and is a doctor .my mother is a docior.
- 7I want to take a sharp knife to kill you in the three days 语法对吗如何翻译
- 8"我希望这个世界充满和平"用英语怎么说?
- 9描写景物的排比句 速求!
- 10修改病句:两个五年级运动员正在操场上训练