mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
Create 1396.c
This commit is contained in:
parent
b8b1673c80
commit
9c501d7b85
26
QUSTOJ/1396.c
Normal file
26
QUSTOJ/1396.c
Normal file
|
@ -0,0 +1,26 @@
|
|||
#include <stdio.h>
|
||||
long list[4];
|
||||
void swap(long* a,long* b)
|
||||
{
|
||||
long tmp=*a;
|
||||
*a=*b;
|
||||
*b=tmp;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
scanf("%ld %ld %ld %ld",&list[0],&list[1],&list[2],&list[3]);
|
||||
int i,j;
|
||||
for(i=0;i<4;i++)
|
||||
{
|
||||
for(j=0;j<3;j++)
|
||||
{
|
||||
if(list[j]>list[j+1])
|
||||
{
|
||||
swap(&list[j],&list[j+1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("%ld %ld %ld %ld\n",list[0],list[1],list[2],list[3]);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user