Created
October 26, 2016 09:49
-
-
Save nasko90/4d08edb0e466dd5148f5eee1c638821a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
namespace Operators | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
string a = Console.ReadLine(); | |
int numInt; | |
double numDouble; | |
bool isInt = int.TryParse(a, out numInt); | |
bool isDouble = double.TryParse(a, out numDouble); | |
if (isInt && isDouble) | |
{ | |
Console.WriteLine(numInt+1); | |
} | |
if (isDouble&&!isInt) | |
{ | |
Console.WriteLine("{0:0.00}",numDouble-1); | |
} | |
if (!isDouble&&!isInt) | |
{ | |
Console.WriteLine(a+"*"); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment