We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
usingSystem;usingSystem.Collections.Generic;usingSystem.IO;usingSystem.Text;classSolution{staticvoidMain(String[]args){/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution */intn=Convert.ToInt32(Console.ReadLine());for(inti=0;i<n;i++){stringinput=Console.ReadLine();varevenChars=newStringBuilder();varoddChars=newStringBuilder();for(intj=0;j<input.Length;j++){if(j%2==0)evenChars.Append(input[j]);elseoddChars.Append(input[j]);}Console.WriteLine($"{evenChars} {oddChars}");}}}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 6: Let's Review
You are viewing a single comment's thread. Return to all comments →
Using stringbuilder in C#