Advertisement
Guest User

16. Tricky Strings 1

a guest
Apr 8th, 2017
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.88 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _16_Tricky_Strings
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             char delimiter = char.Parse(Console.ReadLine());
  14.             int number = int.Parse(Console.ReadLine());
  15.             string result = string.Empty;
  16.             for (int i = 0; i < number; i++)
  17.             {
  18.                 if (i == number - 1)
  19.                 {
  20.                     string parseThis = Console.ReadLine();
  21.                     result += parseThis;
  22.                 }
  23.                 else
  24.                 {
  25.                 string parseThis = Console.ReadLine();
  26.                 result += parseThis;
  27.                 result += delimiter;
  28.                 }
  29.             }
  30.  
  31.             Console.WriteLine(result);
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement