Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- string l1,l2,z,s="2134 == 2134";
- int main()
- {
- long long czy=0 ,x,x2,c,zn=0,l2n=0,n=0;
- cin >>l1;
- cin >> z;
- cin >> l2;
- x2=l1.length();
- if(z=="==")
- {
- if (l1==l2)
- {
- cout<<"TAK";
- }else
- cout<<"NIE";
- }
- if(z=="!=")
- {
- if(l1==l2)
- {
- cout<<"NIE";
- }else
- {
- cout<<"TAK";
- }
- }
- if(z=="<")
- {
- if (l1.length()<l2.length())
- {
- cout<<"TAK";
- } else
- {
- if (l1.length()==l2.length()&&l1!=l2)
- {
- for(c=0;c<x2;c++)
- {
- if (l1[c]<l2[c])
- {
- cout<<"TAK";
- czy=1;
- break;
- }
- }
- if (czy!=1)
- {
- cout<<"NIE";
- }
- }else {
- cout<< "NIE";
- }
- }
- }
- if(z==">")
- {
- if (l1.length()>l2.length())
- {
- } else
- {
- if (x2==l2.length()&&l1!=l2)
- {
- for(c=0;c<x2;c++)
- {
- if (l1[c]>l2[c])
- {
- cout<<"TAK";
- czy=1;
- break;
- }
- }
- if (czy!=1)
- cout<<"NIE";
- }else {
- cout <<"NIE";
- }
- }
- }
- if(z=="<=")
- {
- if (l1.length()<l2.length()||l1==l2)
- {
- cout<<"TAK";
- } else
- {
- if (l1.length()==l2.length())
- {
- for(c=0;c<x2+1;c++)
- {
- if (l1[c]<l2[c])
- {
- cout<<"TAK";
- break;
- }else {
- if (l1[c]>l2[c])
- {
- cout << "NIE";
- break;
- }
- }
- if (c=x2)
- {
- cout <<"TAK";
- break;
- }
- }
- }else{
- cout <<"NIE";
- }
- }
- }
- if(z==">=")
- {
- if (l1.length()>l2.length()||l1==l2)
- {
- cout<<"TAK";
- } else
- {
- if (l1.length()==l2.length())
- {
- for(c=0;c<x2;c++)
- {
- if (l1[c]>l2[c])
- {
- cout<<"TAK";
- czy=1;
- break;
- }
- }
- if(czy!=1)
- cout<<"NIE";
- } else{
- cout <<"NIE";
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement