Witam. Czy jest ktoś, kto orientuje się co trzeba poprawić w tym programie?
#include <iostream>
#include <string>
using namespace std;
int main()
{
string a, b,c;
while(cin>>a>>b>>c)
{
if(b=="==")
if(a.length()==c.length())
{int i=0;
while(a[i]==c[i] and i<a.length()) i++;
if (i==a.length()) cout<<1<<endl;
else cout<<0<<endl;
}
else cout<<0<<endl;
if(b=="<=")
if(a.length()>c.length())
cout<<0<<endl;
else
if(a.length()<c.length())
cout<<1<<endl;
{int i=0;
while(a[i]<=c[i] and i<a.length()) i++;
if (i<=a.length()) cout<<1<<endl;
else cout<<0<<endl;
}
if(b==">=")
if(a.length()<c.length())
cout<<0<<endl;
else
if(a.length()>c.length())
cout<<1<<endl;
else
{
int i=0;
while(a[i]>=c[i] and i<a.length())
i++;
if (i>=a.length())
cout<<1<<endl;
else cout<<0<<endl;
}
if(b=="!=")
if(a.length()!=c.length())
cout<<1<<endl;
else
{
int i=0;
while(a[i]==c[i] and i<a.length()) i++;
if (i==a.length()) cout<<0<<endl;
else cout<<1<<endl;
}
}
return 0;
}