View Code of Problem 78

#include<stdio.h>
#include<string.h>
int main()
{
	int i,j,temp;
	char a[3][100],t[100];
	gets(a[0]);
	gets(a[1]);
	gets(a[2]);
	for(int i=0;i<3;i++)
	{
		for(int j=1;j<3;j++)
		{
			if(strcmp(a[j-1],a[j])>0)
			{
				strcpy(t,a[j-1]);
				strcpy(a[j-1],a[j]);
				strcpy(a[j],t);
			}
		}
	}
	printf("%s\n%s\n%s\n",a[0],a[1],a[2]);
}

Double click to view unformatted code.


Back to problem 78