Advertisement
YavorGrancharov

Tricky_Strings_II

Oct 7th, 2017
124
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 Tricky_Strings_II
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string delimiter = Console.ReadLine();
  10.             int n = int.Parse(Console.ReadLine());
  11.  
  12.             string concat = string.Empty;
  13.             for (int i = 0; i < n; i++)
  14.             {
  15.                 string input = Console.ReadLine();
  16.                 concat += input + delimiter;
  17.             }
  18.             if (concat.EndsWith(delimiter))
  19.             {
  20.                 Console.WriteLine(concat.Remove(concat.Length - delimiter.Length));
  21.             }
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement