int main()
{
int s;
int n;
float avg; scanf("%d,%d",&s,&n); //特别注意的地方 // scanf("%d",&n); avg=s/n;
printf("avg is %f \n",avg); return ;
}
#include <stdio.h> int main()
{
int i;
int n=;
int s=;
while()
{
scanf("%d",&i);
if(i==)
{
break;
}
n++;
s+=i;
}
printf("%d,%d\n",s,n);
return ;
}
./input.out | ./avg.out