View Code of Problem 78

#include<stdio.h>
#include<string.h>
main(){
	char str1[100],str2[100],str3[100],a[100];
	scanf("%s%s%s",str1,str2,str3);
	if(strcmp(str1,str2)>0){
		strcpy(a,str1);
		strcpy(str1,str2);
		strcpy(str2,a);
	}
	if(strcmp(str1,str3)>0){
		strcpy(a,str1);
		strcpy(str1,str3);
		strcpy(str3,a);
	}
	if(strcmp(str2,str3)>0){
		strcpy(a,str2);
		strcpy(str2,str3);
		strcpy(str3,a);
	}
	printf("%s\n%s\n%s\n",str1,str2,str3);
}

Double click to view unformatted code.


Back to problem 78