View Code of Problem 76

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

Double click to view unformatted code.


Back to problem 76