[ create a new paste ] login | about

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

C, pasted on Nov 4:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <stdio.h>
int main()
{
	int a[9]={1,2,3,4,6,9,12,23,45},b[10],i,n;
	n=5;
	for(i=0;i<9;i++)
	{if(a[i]<n) b[i]=a[i]; else break; }
	b[i] = n;
while (++i != 10)
b[i]=a[i-1];
for(i=0;i<10;i++)
printf("%d ", b[i]);
	printf("\n");
	return 0;
}


Output:
1
1 2 3 4 5 6 9 12 23 45 


Create a new paste based on this one


Comments: