Create 1396.c

pull/21/head^2
Kirigaya Kazuto 2016-06-11 20:23:56 +08:00 committed by GitHub
parent b8b1673c80
commit 9c501d7b85
1 changed files with 26 additions and 0 deletions

26
QUSTOJ/1396.c Normal file
View 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;
}