Skip to content

Instantly share code, notes, and snippets.

@nasko90
Created October 26, 2016 09:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nasko90/4d08edb0e466dd5148f5eee1c638821a to your computer and use it in GitHub Desktop.
Save nasko90/4d08edb0e466dd5148f5eee1c638821a to your computer and use it in GitHub Desktop.
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