2015-05-16から1日間の記事一覧

差し金

差し金の形に 'a' を出力するプログラムです。 using System; using System.Collections.Generic; using System.Linq; class Program { static void Square(int n) { // 左下を (0, 0) とする for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { …

Enumerable.GroupBy メソッドで偶数と奇数に分ける

Enumerable.GroupBy メソッドで、数列を偶数と奇数に分けます。 クエリ式と、メソッド呼び出し構文の 2 通りの方法でプログラムを書いてみました。クエリ式いいですね。 using System; using System.Collections.Generic; using System.Linq; class Program …