Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- int main()
- {
- char first[2], second[2];
- cin>>first>>second;
- int i,count=0;
- i= strlen(first);
- for(int n=0; n<i; n++)
- {
- if(first[n]!=second[n])
- {
- if(first[n]!=second[n]+32||first[n]!=second[n]-32)
- {
- if(first[n]<91 && second[n]<91)
- {
- count=count+first[n]-second[n];
- }
- else if(first[n]>96 && second[n]>96)
- {
- count=count+first[n]-second[n];
- }
- else if (first[n]>96 && second[n]<91)
- {
- second[n]=second[n]+32;
- count=count+first[n]-second[n];
- }
- else if (first[n]<91 && second[n]>96)
- {
- first[n]=first[n]+32;
- count=count+first[n]-second[n];
- }
- }
- }
- }
- cout<<count;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement