Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _4TripleSum
- {
- class Program
- {
- static void Main(string[] args)
- {
- char[] arr1 = Console.ReadLine().Split().Select(char.Parse).ToArray();
- char[] arr2 = Console.ReadLine().Split().Select(char.Parse).ToArray();
- var minLength = Math.Min(arr1.Length, arr2.Length);
- bool isFirst = false;
- for (int i = 0; i < minLength; i++)
- {
- var index1 = (int)arr1[i];
- var index2 = (int)arr2[i];
- if (index1 <= index2)
- {
- isFirst = true;
- }
- else
- {
- break;
- }
- }
- if (isFirst)
- {
- Console.WriteLine(string.Join("", arr1));
- Console.WriteLine(string.Join("", arr2));
- }
- else
- {
- Console.WriteLine(string.Join("", arr2));
- Console.WriteLine(string.Join("", arr1));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement