Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- void processString(string one , string two){
- if(one < two){
- cout<<"-1"<<endl;
- }
- if(one > two){
- cout<<"1"<<endl;
- }
- if(one == two){
- cout<<"0"<<endl;
- }
- }
- void conversion(string nameOne , string nameTwo , int length){
- for(int i = 0 ; i < length ; i++){
- int c = nameOne.at(i);
- int a = nameTwo.at(i);
- if(isupper(c)){
- nameOne.at(i) = tolower(c);
- }
- if(isupper(a)){
- nameTwo.at(i) = tolower(a);
- }
- }
- processString(nameOne , nameTwo);
- }
- int main() {
- string one;
- string two;
- cin>> one >> two;
- int lengthOne = one.length();
- int lengthTwo = two.length();
- if(lengthOne <= 100 && lengthTwo <=100 && lengthOne == lengthTwo){
- conversion(one , two , lengthOne);
- }else{
- exit(0);
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment