#include <iostream>
using namespace std;
int main()
{
int x;
int y;
cout << “xの値は” << x << “ですn”;
cout << “yの値は” << y << “ですn”;
cout << “合計は” << x + y << “ですn”;
cout << “平均は” << (x + y) / 2 << “です。n”;
return 0;
}
#include <iostream>
using namespace std;
int main()
{
int x;
int y;
cout << “xの値は” << x << “ですn”;
cout << “yの値は” << y << “ですn”;
cout << “合計は” << x + y << “ですn”;
cout << “平均は” << (x + y) / 2 << “です。n”;
return 0;
}
//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();
}
}
using System;
class type06
{
public static void Main()
{
Console.WriteLine(“decimal:{0}~{1}”, decimal.MinValue,
decimal.MaxValue);
}
}
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);
}
}
using System;
class type02
{
public static void Main()
{
Console.Write(“整数を入力してください—“);
int x = Convert.ToInt32(Console.ReadLine());
Console.WriteLine(“今の数字を2倍すると{0}ですね。”, x * 2);
Console.Write(“あなたの年齢を入力してください—“);
ushort age = Convert.ToUInt16(Console.ReadLine());
Console.WriteLine(“あと{0}年で100歳ですね”, 100 – age);
}
}