Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class GPiSi
- {
- static void Main()
- {
- string cordinatesString = Console.ReadLine();
- long countOdd=0;
- long countEven=0;
- for (int i = 0; i < cordinatesString.Length; i++)
- {
- if (char.IsDigit(cordinatesString[i]))
- {
- if (long.Parse(cordinatesString[i].ToString())%2==1)
- {
- countOdd +=long.Parse(cordinatesString[i].ToString());
- }
- else
- {
- countEven += long.Parse(cordinatesString[i].ToString());
- }
- }
- }
- if (countEven>countOdd)
- {
- Console.WriteLine("right {0}",countEven);
- }
- else if (countOdd>countEven)
- {
- Console.WriteLine("left {0}",countOdd);
- }
- else
- {
- Console.WriteLine("straight {0}", countOdd);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement