View Code of Problem 78

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main (){
	char s1[1010], s2[1010], s3[1010], t[1010];
	scanf("%s", s1);
	scanf("%s", s2);
	scanf("%s", s3);
	if(strcmp(s1, s2)>0){
		strcpy(t, s2);
		strcpy(s2, s1);
		strcpy(s1, t);		
	}
	if(strcmp(s1, s3)>0){
		strcpy(t, s3);
		strcpy(s3, s1);
		strcpy(s1, t);		
	}
	if(strcmp(s2, s3)>0){
		strcpy(t, s3);
		strcpy(s3, s2);
		strcpy(s2, t);		
	}
	puts(s1);
	puts(s2);
	puts(s3);

	return 0;
}

Double click to view unformatted code.


Back to problem 78