View Code of Problem 78

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main() {
	char str1[100],str2[100],str3[100],temp[100];
	gets(str1);
	gets(str2);
	gets(str3);
	if(strcmp(str1,str2)>0){
		strcpy(temp,str1);
		strcpy(str1,str2);
		strcpy(str2,temp);
	}
	if(strcmp(str1,str3)>0){
		strcpy(temp,str1);
		strcpy(str1,str3);
		strcpy(str3,temp);
	}
	if(strcmp(str2,str3)>0){
		strcpy(temp,str2);
		strcpy(str2,str3);
		strcpy(str3,temp);
	}
	puts(str1);
	puts(str2);
	puts(str3);
}

Double click to view unformatted code.


Back to problem 78