[ create a new paste ] login | about

Link: http://codepad.org/k4eO908O    [ raw code | output | fork ]

C, pasted on Jan 14:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
int main()
{
int shuzu[5]={1,4,2,8,7};
int i,j;
for(i=0;i<5;i++)
for(j=1;j<=i;j++)
if(shuzu[j-1]>shuzu[j])
{
int a=shuzu[j-1];
shuzu[j-1]=shuzu[j];
shuzu[j]=a;
}
for(i=0;i<5;i++)printf("%d\n",shuzu[i]);
}


Output:
1
2
3
4
5
6
7
1
2
4
7
8

Exited: ExitFailure 2


Create a new paste based on this one


Comments: