Advertisement
Guest User

Untitled

a guest
Jan 31st, 2017
374
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.61 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _16.TrickyStrings
  4. {
  5.     public class TrickyStrings
  6.     {
  7.         public static void Main()
  8.         {
  9.             string delimiter = Console.ReadLine();
  10.             int n = int.Parse(Console.ReadLine());
  11.             string result = "";
  12.  
  13.             for (int i = 1; i <= n; i++)
  14.             {
  15.                 string word = Console.ReadLine();
  16.                 result += word + delimiter;
  17.  
  18.             }
  19.  
  20.             string removeLastChar = result.Remove(result.Length - delimiter.Length, delimiter.Length);
  21.             Console.WriteLine($"{removeLastChar}");
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement