Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- public static void Main()
- {
- string num = Console.ReadLine();
- int value1;
- double value2;
- if (int.TryParse(num, out value1)) {
- Console.Write(value1);
- }
- else if (double.TryParse(num, out value2)) {
- Console.Write(Math.Round(value2, 0));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement