/*平均值计算*/
#include<stdio.h>#include<stdlib.h>int main(void)
{ double n1,n2,n3,average; /*3个输入数、平均值变量*/ printf("\n Welcome.\nCalculate the average.\n" "give three numbers.\n"); /*打印程序标题*/ printf("Input three numbers(eg.1.2,2.3,3.4):"); scanf("%lf,%lf,%lf",&n1,&n2,&n3); /*输入三个数据*/ average=(n1+n2+n3)/3.0; /*计算平均值*/ printf("average=%.2f\n",average); /*输出平均值*/ system("PAUSE"); return 0; } /*end main*/