求平均数 double=(数字的和)/4.0 除以浮点数
#include <iostream>
#include <stdio.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int main(int argc, char** argv) {
char a;
int b;
double c,d;
scanf("%lf %d %c %lf",&c,&b,&a,&d);
printf("%c %d %.2f %.2f",a,b,c,d);
//输入在一行中顺序给出浮点数1、整数、字符、浮点数2,其间以1个空格分隔。
//在一行中按照字符、整数、浮点数1、浮点数2的顺序输出,其中浮点数保留小数点后2位。
return 0;
}
原文:http://www.cnblogs.com/ligen/p/4235982.html