開発環境
- OS: Windows 10 Pro
- IDE(統合開発環境): Visual Studio Community 2017
初めてのC# 第2版 (Jesse Liberty (著)、Brian MacDonald (著)、日向 俊二 (翻訳)、オライリージャパン)の4章(演算子)、4.6(練習問題)、練習4-3.を取り組んでみる。
コード
using System;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
{
int a = 0;
int b = 0;
int c = ++a;
int d = b++;
int e = 0;
int f = 0;
int g = --e;
int h = f--;
int[] nums = { a, b, c, d, e, f, g, h };
foreach (int num in nums)
{
Console.WriteLine(num);
}
}
}
}
入出力結果(Terminal)
1 1 1 0 -1 -1 -1 0 続行するには何かキーを押してください . . .
0 コメント:
コメントを投稿