C# String to Char

using System;
using System.Collections.Generic;
using System.IO;
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 */

        //Console.WriteLine(args[0]);

       var strCount = Int32.Parse(Console.ReadLine()) ;

       for (var i=0; i<strCount; i++){
            var str = Console.ReadLine();
            //Console.WriteLine(str);
            var oddStr = "";
            var evenStr = "";
            var j = 0;
            foreach (char c in str){
                if (( j % 2)==0){
                     evenStr  += c;  
                }else{
                    oddStr += c;
                }
                j += 1;
            }

            Console.WriteLine(evenStr + " " + oddStr  );
            
       }
      


    }
}



留言

這個網誌中的熱門文章

香港袐密行動

要老是忘記, 我更記不起