C++ 論理演算子

#include <iostream>
using namespace std;

int main()
{
int month;
cout << “季節を求めます。n何月ですか:”;
cin >> month;

if (month >= 3 && month <= 5)
cout << “それは春です。n”;
else if (month >= 6 && month <= 8)
cout << “それは夏です。n”;
else if (month >= 9 && month <= 11)
cout << “それは秋です。n”;
else if (month == 12 || month == 1 || month == 2)
cout << “それは冬です。n”;

return 0;
}

C# 文字型

//type08.cs

using System;

class type08
{
    public static void Main()
    {
        char a = ‘猫’, b = ‘で’, c = ‘も’, d = ‘わ’, e = ‘か’, f = ‘る’;
        Console.Write(a);
        Console.Write(b);
        Console.Write(c);
        Console.Write(d);
        Console.Write(e);
        Console.Write(f);

        Console.WriteLine();
    }
}

C# decimal型

using System;

class type06
{
    public static void Main()
    {
        Console.WriteLine(“decimal:{0}~{1}”, decimal.MinValue,
                                             decimal.MaxValue);
    }
}

C# 浮動小数点数型

using System;

class type04
{
    public static void Main()
    {
        Console.WriteLine(“float: {0}~{1}”, float.MinValue,
                                            float.MaxValue);
        Console.WriteLine(“double:{0}~{1}”,double.MinValue,
                                            double.MaxValue);
    }
}