问题描述: 从键盘上输入一批数据,以0作为结束标志,统计出输入数的个数和最大值和平均值.(while循环语句) 1个回答 分类:综合 2014-11-07 问题解答: 我来补答 #include <stdio.h>int main(void){ int count=0; int sum=0; int max; int temp=0; double ave=0.0; max=-(0xFFFFFFFE)-1; while(1) { scanf("%d",&temp); if(temp==0) break; else { count++; sum = sum+temp; if( temp>max ) max=temp; } } ave=sum/count; printf("输入个数为=%d\n",count); printf("最大值为=%d\n",max); printf("平均值为=%lf\n",ave); return 0;} 展开全文阅读