Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Task2
- {
- class Program
- {
- static void Main(string[] args)
- {
- //var collection = Console.ReadLine().Select(c => Int32.Parse(c.ToString()));
- var userInput = Int32.Parse(Console.ReadLine());
- int hundreds = userInput / 100;
- int tens = (userInput / 10) % 10;
- int singles = userInput % 10;
- int resultHundreds = ( tens + hundreds >= 10 ? ((tens+hundreds)/10 + (tens+hundreds) % 10) : (tens + hundreds));
- int resultRightHalf = (singles % 2 == 0 ? singles * 2 : singles + tens);
- Console.WriteLine(resultHundreds.ToString() + resultRightHalf.ToString("00"));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement