Advertisement
madidino

teza7-sub3-1

Nov 12th, 2023 (edited)
764
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstring>
  3. using namespace std;
  4. int main()
  5. {
  6.     char s[100],c[100];
  7.     cin>>s>>c;
  8.     int mx=(int)'z';
  9.     for(int i=0;i<strlen(s);i++)
  10.     {
  11.         if(s[i]+((int)c[i]-'0')>'z')
  12.         {
  13.             s[i]='a'+((int)(s[i]+(int)(c[i]-'0'))%mx);
  14.         }
  15.         else
  16.         {
  17.             s[i]=s[i]+(int)(c[i]-'0');
  18.         }
  19.     }
  20.     cout<<s;
  21. }
  22. //info 3212
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement