View Code of Problem 78

#include<bits/stdc++.h>
using namespace std;
int main(){
	char a1[100],b1[100],c1[100],t[100];
	gets(a1);
	gets(b1);
	gets(c1);
	if(strcmp(a1,b1)>0){
		strcpy(t,a1);
		strcpy(a1,b1);
		strcpy(b1,t);
	}
	if(strcmp(a1,c1)>0){
		strcpy(t,a1);
		strcpy(a1,c1);
		strcpy(c1,t);
	}
	if(strcmp(b1,c1)>0){
		strcpy(t,b1);
		strcpy(b1,c1);
		strcpy(c1,t);
	}
	puts(a1);
	puts(b1);
	puts(c1);
	return 0;
}

Double click to view unformatted code.


Back to problem 78