#include<stdio.h>
void main()
{
float a,b,c;
printf("please input two number!\n");
scanf("%f %f",&a,&b);
if (a>b)
{
c=a;
a=b;
b=a;
}
printf("The max number is %f\n",&a);
printf("The min number is %f\n",&b);
}
有图有真相
#include<stdio.h>
void main()
{
float a,b,c;
printf("please input two number!\n");
scanf("%f %f",&a,&b);
if (a<b)
{
c=a;
a=b;
b=c;
}
printf("The max number is %5.2f\n",a);
printf("The min number is %5.2f\n",b);
}
#include<stdio.h>
void main()
{
float a,b,c;
printf("please input two number!\n");
scanf("%f %f",&a,&b);
if (a<b)
{ a=a+b; b=a-b; a=a-b;
}
printf("The max number is %5.2f\n",a);
printf("The min number is %5.2f\n",b);
}