#include<stdio.h>int main(){ int s,count; scanf("%d %d",&s,&count); float avg; avg = s / count; printf("The average value is %.3f\n",avg); return 0;}#include<stdio.h>int main(){ printf("Input some int value (end by 0):\n"); int i,s=0,count=0; int flag=1; while(flag){ scanf("%d",&i); if(i == 0) break; s+=i; count++; } printf("%d %d\n",s,count); return 0;}
添加回答
举报
0/150
提交
取消