Advertisement
braveheart1989

CompareCharArrays

May 22nd, 2016
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.75 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 _03.CompareCharArrays
  8. {
  9.     class CompareCharArrays
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.              string chars1 = Console.ReadLine();
  14.             string chars2 = Console.ReadLine();
  15.             //int minLength = Math.Min(chars1.Length, chars2.Length);
  16.  
  17.             if (chars1.CompareTo(chars2) < 0)
  18.             {
  19.                 Console.WriteLine("<");
  20.             }
  21.             else if (chars1.CompareTo(chars2) > 0)
  22.             {
  23.                 Console.WriteLine(">");
  24.             }
  25.             else
  26.             {
  27.                 Console.WriteLine("=");
  28.  
  29.             }
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement