Advertisement
Ankit_132

A

Feb 14th, 2024
982
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int t;
  6.     cin>>t;
  7.    
  8.     while(t--){
  9.         int n;
  10.         string a, b;
  11.         cin>>n>>a>>b;
  12.        
  13.         for(int i=0; i<n; i++)
  14.         {
  15.             int cnt = 0;
  16.            
  17.             while(a[i] != b[i]){
  18.                 cnt++;
  19.                 a[i] += 3;
  20.                
  21.                 if(a[i] > 'Z')
  22.                     a[i] = 'A' + (a[i]-'Z'-1);
  23.             }
  24.            
  25.             cout<<cnt<<" ";
  26.         }
  27.        
  28.         cout<<"\n";
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement