View Code of Problem 76

#include<stdio.h>
#include<stdlib.h>

int main(){
	int a[10],i,j,temp;
	for(i=0;i<9;i++){
		scanf("%d",&a[i]);
	}
	scanf("%d",&temp);
	i=0;
	while(a[i]<temp){
		i++;
	}
	for(j=8;j>=i;j--)
	a[j+1]=a[j];
	a[i]=temp;
	for(i=0;i<10;i++){
		printf("%d",a[i]);
		if(i!=9) printf("\n");
	}
} 

Double click to view unformatted code.


Back to problem 76