Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.IO;
- class Program
- {
- static void Main()
- {
- //variables:
- char[] stringS;
- string str;
- str = Console.ReadLine();
- stringS = str.ToCharArray();
- int Q;
- Q = Convert.ToInt32(Console.ReadLine());
- int stop = 2 + Q;
- for (int i = 2; i < stop; ++i)
- {
- string[] nums_strings = Console.ReadLine().Split();
- int[] nums = new int[nums_strings.Length];
- for (int j = 0; j < nums_strings.Length; j++)
- nums[j] = Convert.ToInt32(nums_strings[j]);
- int L = nums[0];
- int R = nums[1];
- ReverseCase(stringS, L, R);
- }
- Console.WriteLine(new string(stringS));
- }
- static void ReverseCase(char[] array, int startIndex, int stopIndex)
- {
- for (int i = startIndex - 1; i < stopIndex; ++i)
- {
- if (char.IsLower(array[i]))
- {
- array[i] = char.ToUpper(array[i]);
- }
- else
- {
- array[i] = char.ToLower(array[i]);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement