Saleh127

CC totr

Oct 9th, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long
  4. #define test int t; cin>>t; for(int cs=1;cs<=t;cs++)
  5. int main()
  6. {
  7. ios_base::sync_with_stdio(0);
  8. cin.tie(0);cout.tie(0);
  9.  
  10. string a;
  11. ll c,d,e,f,j,i,k,l;
  12. cin>>c>>a;
  13. string x;
  14. while(c--)
  15. {
  16. cin>>x;
  17. for(i=0;i<x.size();i++)
  18. {
  19. if(x[i]=='_') cout<<" ";
  20. else if(x[i]>='a' && x[i]<='z')
  21. {
  22. k=x[i]-'a';
  23. cout<<a[k];
  24. }
  25. else if(x[i]>='A' && x[i]<='Z')
  26. {
  27. k=x[i]-'A';
  28. char ch=a[k]-32;
  29. cout<<ch;
  30. }
  31. else cout<<x[i];
  32. }
  33. cout<<endl;
  34. }
  35.  
  36. return 0;
  37. }
  38.  
Add Comment
Please, Sign In to add comment