Advertisement
Sitisom

EVM9

Sep 23rd, 2019
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.72 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 ConsoleApp1
  8. {
  9.     class Program
  10.     {
  11.        
  12.  
  13.         static void Main(string[] args)
  14.         {
  15.             StringBuilder a = new StringBuilder(Console.ReadLine());
  16.             for(int i = 0; i < a.Length - 1; i+=2)
  17.             {
  18.                 char x = a[i];
  19.                 a[i] = a[i + 1];
  20.                 a[i + 1] = x;
  21.             }
  22.             Console.WriteLine(a);
  23.  
  24.             string[] b = a.ToString().Split();
  25.  
  26.             for(int i = 0; i < b.Length; i++)
  27.             {
  28.                 if (b[i].Length <= 5) Console.WriteLine(b[i]);
  29.             }
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement