開発環境
- OS: macOS High Sierra - Apple
- IDE(統合開発環境): Visual Studio for Mac
- プログラミング言語: C#
初めてのC# 第2版 (Jesse Liberty (著)、Brian MacDonald (著)、日向 俊二 (翻訳)、オライリージャパン)の5章(実行制御)、5.5(練習問題)、練習5-1.を取り組んでみる。
コード
using System;
namespace Sample5_1
{
class Program
{
static void Main(string[] args)
{
int count = 1;
while (count <= 10)
{
Console.WriteLine(count);
count++;
}
count = 0;
do
{
count++;
Console.WriteLine(count);
} while (count < 10);
for (int count1 = 1; count1 <= 10; count1++)
{
Console.WriteLine(count1);
}
}
}
}
入出力結果(Terminal)
1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 -bash: /var/folders/jg/y5d0zx4n1c9644tjrmn90jpc0000gn/T/tmp31fc06e7.tmp: cannot overwrite existing file Press any key to continue...
0 コメント:
コメントを投稿