• + 0 comments

    C# Solution class Solution {

    static void Main(String[] args) {
        /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution */
        //number of test cases 
        int n = Convert.ToInt32(Console.ReadLine());
    
        string[] s = new string[n];
    
        for(int i = 0; i < s.Length; i++)
        { 
            string even = string.Empty;
            string odd = string.Empty;
    
            s[i] = Console.ReadLine();
    
            /*Note that :
             string is an array of characters therefore will will convert the 's[i]' to array of 'char'.
            */
            char[] c = s[i].ToCharArray();
    
            for(int j = 0; j < c.Length ; j++)
            {
                // use modulus '%' to check remainder from the indexes
                if(j % 2 == 0)
                  even += c[j]; 
                else
                  odd += c[j];       
            }
            Console.Write($"{even} {odd}");
            Console.WriteLine();
        }    
    
    
    }
    

    }