Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace Game
- {
- class Program
- {
- static void Main(string[] args)
- {
- string n = Console.ReadLine();
- List<int> number = n.ToString()
- .Select(x => Convert.ToInt32(x.ToString()))
- .ToList();
- int case1 = number[0] + number[1] + number[2];
- int case2 = number[0] * number[1] + number[2];
- int case3 = number[0] + number[1] * number[2];
- int case4 = number[0]*number[1]*number[2];
- //int case5 = number[0] * number[1] * number[2];
- int result = Math.Max(case1,(Math.Max(case2,(Math.Max(case3,case4)))));
- Console.WriteLine(result);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement