Advertisement
minnera

#30daysofcode #day6

Oct 2nd, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.87 KB | None | 0 0
  1. //https://www.hackerrank.com/challenges/30-review-loop
  2.  
  3. using System;
  4. using System.Collections.Generic;
  5. using System.IO;
  6. class Solution {
  7.     static void Main(String[] args) {
  8.         /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution */
  9.         int db = int.Parse(Console.ReadLine());
  10.         string[] tomb = new string[db];
  11.         for(int i = 0; i < db; i++){
  12.             tomb[i] = Console.ReadLine();
  13.         }
  14.         for(int i = 0; i < db; i++){
  15.           string paros = "";
  16.           string paratlan = "";
  17.           for(int j = 0; j < tomb[i].Length; j++){
  18.               if(j % 2 == 0){
  19.                   paros += tomb[i][j];
  20.               }
  21.               else{
  22.                   paratlan += tomb[i][j];
  23.               }
  24.           }
  25.           Console.WriteLine(paros + " " + paratlan);
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement