View Code of Problem 76

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

Double click to view unformatted code.


Back to problem 76