View Code of Problem 78

#include <stdio.h>
#include <string.h>
int main(){
	char a[3][50],b[50];
	int i,j,max;
	for(i=0;i<3;i++){
		scanf("%s",a[i]);
	}
	for(i=1;i<=2;i++){
		max=0;
		for(j=0;j<4-i;j++){
			if(strcmp(a[j],a[max])>0) max=j;
		}
		strcpy(b,a[max]);
		strcpy(a[max],a[3-i]);
		strcpy(a[3-i],b);
	}
	for(i=0;i<3;i++){
		puts(a[i]);
	}
}

Double click to view unformatted code.


Back to problem 78