#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;
}
田心枫
相关分类