開発環境
- OS: Windows 10 Pro
- IDE(統合開発環境): Visual Studio Community 2017
Head First C# ―頭とからだで覚えるC#の基本 (Andrew Stellman (著)、Jennifer Greene (著)、佐藤 嘉一 (監修, 監修)、木下 哲也 (翻訳)、オライリージャパン)の2章(あくまでコードである - 内部では)、プールパズル(p. 80)を取り組んでみる。
コード
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Chapter_2
{
class Chapter2PoolPuzzle
{
public static void Main()
{
int x = 0;
String Poem = "";
while (x < 4)
{
Poem += "a";
if (x < 1)
{
Poem += " ";
}
Poem += "n";
if (x > 1)
{
Poem += " oyster";
x += 2;
}
if (x == 1)
{
Poem += "noys ";
}
if (x < 1)
{
Poem += "oise ";
}
x += 1;
}
MessageBox.Show(Poem);
}
}
}
0 コメント:
コメントを投稿