View Code of Problem 76

#include<stdio.h>
#include<math.h>

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

Double click to view unformatted code.


Back to problem 76