Guest User

Untitled

a guest
Oct 20th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. void processString(string one , string two){
  6.  
  7. if(one < two){
  8.  
  9. cout<<"-1"<<endl;
  10.  
  11. }
  12.  
  13. if(one > two){
  14.  
  15. cout<<"1"<<endl;
  16.  
  17. }
  18.  
  19. if(one == two){
  20.  
  21. cout<<"0"<<endl;
  22.  
  23. }
  24.  
  25. }
  26.  
  27. void conversion(string nameOne , string nameTwo , int length){
  28.  
  29.  
  30. for(int i = 0 ; i < length ; i++){
  31.  
  32. int c = nameOne.at(i);
  33.  
  34. int a = nameTwo.at(i);
  35.  
  36. if(isupper(c)){
  37.  
  38. nameOne.at(i) = tolower(c);
  39. }
  40.  
  41. if(isupper(a)){
  42.  
  43. nameTwo.at(i) = tolower(a);
  44.  
  45. }
  46. }
  47.  
  48. processString(nameOne , nameTwo);
  49.  
  50. }
  51.  
  52. int main() {
  53.  
  54. string one;
  55.  
  56. string two;
  57.  
  58. cin>> one >> two;
  59.  
  60. int lengthOne = one.length();
  61.  
  62. int lengthTwo = two.length();
  63.  
  64. if(lengthOne <= 100 && lengthTwo <=100 && lengthOne == lengthTwo){
  65.  
  66. conversion(one , two , lengthOne);
  67.  
  68. }else{
  69.  
  70. exit(0);
  71.  
  72. }
  73. return 0;
  74. }
Add Comment
Please, Sign In to add comment