Advertisement
Guest User

Untitled

a guest
Oct 21st, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.96 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3.  
  4. namespace Teodor
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             string[] Places = new string[50];
  11.             Console.WriteLine("Vyvedete naseleno mqsto ili 0 za da sprete vyvejdaneto:");
  12.             for (int i = 0; i < Places.Length; i++)
  13.             {
  14.                 string r = Console.ReadLine();
  15.                 if(r == "0")
  16.                 {
  17.                     break;
  18.                 }else
  19.                 {
  20.                     Places[i] = r;
  21.                 }
  22.             }
  23.             Console.WriteLine("Printing places that meet cond:");
  24.             foreach (var item in Places)
  25.             {
  26.                 if(item == null)
  27.                 {
  28.                     continue;
  29.                 }
  30.  
  31.                 if(item.Any(Char.IsWhiteSpace))
  32.                 {
  33.                     Console.Write("{0},",item);
  34.                 }
  35.             }
  36.  
  37.         }
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement