Looks like above solutions aren't using compare method and implementing total again so here is my solution and hope it works for you (It's working fine).
#include
#include
#include
using namespace std;
string tolow(string a)
{
for(unsigned int i=0;i>str1>>str2;
int temp=tolow(str1).compare(tolow(str2));
if(temp>0)
cout<<1;
else if(temp==0)
cout<<0;
else
cout<<-1;
}