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)
				break;
		}
	for(j=9; j>i; j--)
	{
		num[j]=num[j-1];
	}
	num[i]=temp;
	for(i=0; i<10; i++)
		printf("%d\n",num[i]);
	return 0;
}

Double click to view unformatted code.


Back to problem 76