Skip to content

Instantly share code, notes, and snippets.

@Nucleareal
Created April 17, 2014 07:23
Show Gist options
  • Save Nucleareal/10960604 to your computer and use it in GitHub Desktop.
Save Nucleareal/10960604 to your computer and use it in GitHub Desktop.
if文と三項演算子を使わずにaとbの大きい数を表示
using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
namespace Test
{
class Program
{
public static void Main(string[] args)
{
var a = 30;
var b = 20;
var d = new Dictionary<bool, string>() { {false, "{1}"}, {true, "{0}"} };
Console.WriteLine(d[a > b], a, b);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment