Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <bits/stdc++.h>
  4.  
  5. using namespace std;
  6.  
  7.  
  8. int main()
  9. {
  10. int n,p,q,m;
  11. cin >>n;
  12. string s;
  13. cin >> s;
  14. for(int i=0;i<n;i++){
  15. cin >> p;
  16. if(p==1){
  17. cin >> q;
  18. s[q-1] = toupper(s[q-1]);
  19. }
  20. else if (p==2){
  21. cin >> q;
  22. s[q-1] = tolower(s[q-1]);
  23. }
  24. else{
  25. cin >> m;
  26. swap(s[m-1],s[q-1]);
  27. }
  28. }
  29. cout << c;
  30.  
  31. return 0;
  32.  
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement