Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- namespace Last_3_Consecutive_Equal_Strings_II
- {
- class Program
- {
- static void Main(string[] args)
- {
- string[] arr = Console.ReadLine().Split().ToArray();
- for (int i = arr.Length - 1; i >= 0; i--)
- {
- if (arr[i] == arr[i - 1] && arr[i - 1] == arr[i - 2])
- {
- Console.WriteLine("{0} {1} {2}",arr[i],arr[i],arr[i]);
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement