谁能帮我写个c语言程序 ,我是初学者:

来源:百度知道 编辑:UC知道 时间:2024/05/29 09:37:55
从键盘任意输入3个整数,按从大到小顺序输出。

#include <stdio.h>
int main()
{
int a,b,c;
int temp;
printf("Enter 3 numbers :\n");
scanf("%d%d%d",&a,&b,&c);
if(a<b)
{
temp=a;
a=b;
b=temp;
}
if(a<c)
{
temp=a;
a=c;
c=temp;
}
if(b<c)
{
temp=b;
b=c;
c=temp;
}
printf("%d,%d,%d\n",a,b,c);
return 1;
}

#include<stdio.h>
#include<conio.h>

struct questions
{
int n;
char ques[1024];
}q[40];
void main()
{
int i,j,a[3],t;
for (i=0;i<3;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<2;i++)
for(j=i+1;j<3;j++)
if (a[i]>a[j])
{
t=a[j];a[j]=a[i];a[i]=t;
}
for(i=0;i<3;i++)
printf("%d ",a[i]);
printf("\n");
getch();
}

#include<