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], s[1010];
	scanf("%s%s%s", s1, s2, s3);
	if(strcmp(s1, s2)>0){
		strcpy(s, s1);
		strcpy(s1, s2);
		strcpy(s2, s);
	}
	if(strcmp(s1, s3)>0){
		strcpy(s, s1);
		strcpy(s1, s3);
		strcpy(s3, s);
	}
	if(strcmp(s2, s3)>0){
		strcpy(s, s2);
		strcpy(s2, s3);
		strcpy(s3, s);
	}
	puts(s1);
	puts(s2);
	puts(s3);

	return 0;
}

Double click to view unformatted code.


Back to problem 78