For the white of their own today or record it. And not more than than the others and had its own!

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/qq_45672975/article/details/102733217
//将a,b,c3个数据由小到大的输出//
#define _CRT_SECURE_NO_WARNING
#include<stdio.h>
int main()
{
	//定义单精度浮点型//
	float a, b, c,m;
	scanf("%f, %f ,%f", &a, &b,&c);
	if (a > c)
	{
		//实现a与b的互换,a是a,b中较小的一个//
		m= a;
		a = c;
		c = m;
	}
	if (b>c)
	{
		//实现b与c的互换,交换后b是b,c中较小的一个,即b是次小的哪一个//
		m = b;
		b = c;
		c = m;
	}

	//打印a与b互换的结果(得到的结果为b>a)//
	if (a > b)
	{
		//实现a与c的互换,a是a,c中较小的一个,因此a是a,b,c中较小的一个//
		m = a;
		a = b;
		b= m;
	}
	printf("%5.2f,%5.2f,%5.2f\n", a, b,c);
 system("pause");
 return 0;
}

Guess you like

Origin blog.csdn.net/qq_45672975/article/details/102733217
own