View Code of Problem 78

#include<stdio.h>
#include<string.h>
int main(){
	char a[100],b[100],c[100],exchange[100];
	gets(a);
	gets(b);
	gets(c);
	if(strcmp(a,b)>0){
		strcpy(exchange,a);
		strcpy(a,b);
		strcpy(b,exchange);
	}
	if(strcmp(a,c)>0){
		strcpy(exchange,a);
		strcpy(a,c);
		strcpy(c,exchange);
	}
	if(strcmp(b,c)>0){
		strcpy(exchange,b);
		strcpy(b,c);
		strcpy(c,exchange);
	}
	puts(a);
	puts(b);
	puts(c);
}

Double click to view unformatted code.


Back to problem 78