4个回答
展开全部
#include<stdio.h>
void sort(int &a,int &b)//对两个数进行排序
{
int d;
if(a>b)
{
d=a;a=b;b=d;
}
}
void main()
{
int a,b,c,d;
printf("输入三个数");
scanf("%d%d%d",&a,&b,&c);
sort(a,b);
sort(a,c);
sort(b,c);
printf("%d %d %d",a,b,c);
}
void sort(int &a,int &b)//对两个数进行排序
{
int d;
if(a>b)
{
d=a;a=b;b=d;
}
}
void main()
{
int a,b,c,d;
printf("输入三个数");
scanf("%d%d%d",&a,&b,&c);
sort(a,b);
sort(a,c);
sort(b,c);
printf("%d %d %d",a,b,c);
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
#include <stdio.h>
int mian()
{
double number1,number2,number3;
double max,min,middle;
printf("In put three number:\n");
scanf("%l %l %l",&number1,&number2,&number3);
max = number3>(number1>number2?number1:number2)?number3:(number1>number2?number1:number2);
min = number3<(number1<number2?number1:number2)?number3:(number1>number2?number1:number2);
middle = number3>(number1<number2?number1:number2)?number3:(number1>number2?number1:number2);
printf("%l < %l < %l",min,middle,max);
return 0;
}
int mian()
{
double number1,number2,number3;
double max,min,middle;
printf("In put three number:\n");
scanf("%l %l %l",&number1,&number2,&number3);
max = number3>(number1>number2?number1:number2)?number3:(number1>number2?number1:number2);
min = number3<(number1<number2?number1:number2)?number3:(number1>number2?number1:number2);
middle = number3>(number1<number2?number1:number2)?number3:(number1>number2?number1:number2);
printf("%l < %l < %l",min,middle,max);
return 0;
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
........同意楼上,您翻下书吧,肯定有.....
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
这是个最简单的,简单到我都不想再写了……
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询