Advertisement
Guest User

Untitled

a guest
Dec 17th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. char sr(string a, string b,bool a_sign, bool b_sign) {
  2. if (a_sign == true && b_sign == false) return '<';
  3. else if (a_sign == false && b_sign == true) return '>';
  4. else if (a_sing == true && b_sign == true) {
  5. if (a == b) return '=';
  6. if (a.length() > b.length()) return '<';
  7. else if (a.length() < b.length()) return '>';
  8. else {
  9. for (int i = a.length(); i > 0; --i) if (tr(a[i]) > tr(b[i])) return '<'; else if (tr(a[i]) < tr(b[i])) return '>';
  10. }
  11. }
  12. else {
  13. if (a == b) return '=';
  14. if (a.length() > b.length()) return '>';
  15. else if (a.length() < b.length()) return '<';
  16. else {
  17. for (int i = a.length(); i > 0; --i) if (tr(a[i]) > tr(b[i])) return '>'; else if (tr(a[i]) < tr(b[i])) return '<';
  18. }
  19. }
  20. }
  21.  
  22. string tr(long long n) {
  23. string b = "";
  24. for (int i = 0; i < abc.length() - 1; ++i)
  25. if (n == i) { b = abc[i]; return b; }
  26. return "ОШИБКА!";
  27. }
  28. long long tr(char n) {
  29. for (int i = 0; i < abc.length() - 1; ++i)
  30. if (n == abc[i]) return i;
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement