Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main() {
- int a, b, Q;
- std::string text;
- getline(std::cin, text);
- ios_base::sync_with_stdio(false);
- cin.tie(NULL);
- std::cin >> Q;
- for (int i = 0; i < Q; i++) {
- std::cin >> a >> b;
- for (int j = a - 1; j < b; j++) {
- if (isupper(text[j])) {
- text[j] = tolower(text[j]);
- }
- else {
- text[j] = toupper(text[j]);
- }
- }
- }
- std::cout << text;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement