View Code of Problem 76

#include <stdio.h>
int main(){
	int num[10];
	int i,j,temp;
	for(i=0; i<9; i++)
		scanf("%d",&num[i]);
	scanf("%d",&temp);
	for(i=0; i<9; i++)
		{
			if(num[i]>temp)
				j=i;
		}
	for(i=8; i>=j; i--)
	{
		num[i+1]=num[i];
	}
	num[j]=temp;
	for(i=0; i<10; i++)
		printf("%d\n",num[i]);
	return 0;
}

Double click to view unformatted code.


Back to problem 76