using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void WriteSomething<T>(T x, T y)
{
if (typeof(T) == typeof(int))
{
Console.WriteLine(x);
}
if (typeof(T) == typeof(string))
{
Console.WriteLine(y);
}
}
static void Main(string[] args)
{
WriteSomething<int>(0, 9);
WriteSomething<string>("1", "10");
WriteSomething(0, 9);
WriteSomething("0", "9");
Console.ReadLine();
}
}
}
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void WriteSomething<T>(T x, T y)
{
if (typeof(T) == typeof(int))
{
Console.WriteLine(x);
}
if (typeof(T) == typeof(string))
{
Console.WriteLine(y);
}
}
static void Main(string[] args)
{
WriteSomething<int>(0, 9);
WriteSomething<string>("1", "10");
WriteSomething(0, 9);
WriteSomething("0", "9");
Console.ReadLine();
}
}
}