View Code of Problem 78

#include<bits/stdc++.h>
using namespace std;
int main(){
string str1,str2,str3;
cin>>str1>>str2>>str3;
if(str1<str2&&str1<str3)
    {
        if(str2<str3)cout<<str1<<"\n"<<str2<<"\n"<<str3;
        else cout<<str1<<"\n"<<str3<<"\n"<<str2;
    }
if(str2<str1&&str2<str3)
    {
        if(str1<str3)cout<<str2<<"\n"<<str1<<"\n"<<str3;
        else cout<<str2<<"\n"<<str1<<"\n"<<str3;
    }
if(str3<str2&&str3<str1)
    {
        if(str1<str2)cout<<str3<<"\n"<<str1<<"\n"<<str2;
        else cout<<str3<<"\n"<<str2<<"\n"<<str1;
    }
return 0;
}

Double click to view unformatted code.


Back to problem 78