View Code of Problem 78

#include<stdio.h>
#include<string.h>
void main(){
	char str1[10],str2[10],str3[10],temp[10];
	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