Advertisement
Guest User

Untitled

a guest
Jan 19th, 2020
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.15 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 ConsoleApp27
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string newS = " ", last = " ",newSS=" ";
  14.             int len = 0;
  15.             string s1 = Console.ReadLine();
  16.             string s2 = Console.ReadLine();
  17.             string s3 = Console.ReadLine();
  18.             int check = s1.CompareTo(s2);
  19.             if(check>0)
  20.             {
  21.                 newS = s2 + ", " + s1;
  22.                 last = s1;
  23.             }
  24.             else
  25.             {
  26.                 newS = s1 + ", " + s2;
  27.                 last = s2;
  28.             }
  29.             check = newS.CompareTo(s3);
  30.             if(check>0)
  31.             {
  32.                 newSS = s3 + ", " + newS;
  33.             }
  34.             else
  35.             {
  36.                 if(last.CompareTo(s3)>0)
  37.                 {
  38.                     newSS = newS + ", " + s3;
  39.                 }
  40.                 else
  41.                 {
  42.                     len = newS.Length - last.Length;
  43.  
  44.                 }
  45.             }
  46.         }
  47.     }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement