Advertisement
Ronka

Untitled

Jun 10th, 2017
810
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 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 _4TripleSum
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13.  
  14. char[] arr1 = Console.ReadLine().Split().Select(char.Parse).ToArray();
  15. char[] arr2 = Console.ReadLine().Split().Select(char.Parse).ToArray();
  16.  
  17. var minLength = Math.Min(arr1.Length, arr2.Length);
  18. bool isFirst = false;
  19.  
  20. for (int i = 0; i < minLength; i++)
  21. {
  22. var index1 = (int)arr1[i];
  23. var index2 = (int)arr2[i];
  24.  
  25. if (index1 <= index2)
  26. {
  27. isFirst = true;
  28. }
  29. else
  30. {
  31. break;
  32. }
  33.  
  34.  
  35. }
  36.  
  37. if (isFirst)
  38. {
  39. Console.WriteLine(string.Join("", arr1));
  40. Console.WriteLine(string.Join("", arr2));
  41. }
  42. else
  43. {
  44. Console.WriteLine(string.Join("", arr2));
  45. Console.WriteLine(string.Join("", arr1));
  46. }
  47.  
  48.  
  49. }
  50. }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement