View Code of Problem 78

#include<bits/stdc++.h>
using namespace std;
bool cmp(string s1,string s2)
{
    if( s1 > s2 )return false;
    return true;
}
int main()
{
    string sp[3];
    int i,j,k;
    for( i=0;i<3;i++ )
    cin>>sp[i];
    sort(sp,sp+3,cmp);
    for( i=0;i<3;i++ )
    cout<<sp[i]<<endl;
}

Double click to view unformatted code.


Back to problem 78