Advertisement
Aborigenius

TrickyString

Jun 8th, 2017
97
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 Tricky_String
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string delimeter = Console.ReadLine();
  14.             int n = int.Parse(Console.ReadLine());
  15.             string finalWords = "";
  16.             for (int i = 0; i < n; i++)
  17.             {
  18.                 if (i == n -1)
  19.                 {
  20.                     string randomWords = Console.ReadLine();
  21.                     finalWords += randomWords;
  22.                 }
  23.                 else
  24.                 {
  25.                     string randomWords = Console.ReadLine();
  26.                     finalWords += randomWords;
  27.                     finalWords += delimeter;
  28.  
  29.                 }
  30.  
  31.             }
  32.             Console.WriteLine(finalWords);
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement