conversion

使用軟體: Visual c# 2008 Express

-----------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
class conversion
{
static void Main(string[] args)
{
int a = 10;
double b = 0;
b = a;
b = 20.5;
a = (int)b;
Console.WriteLine("a = " + a);
Console.WriteLine("b = " + b);

float c = 20;
c = 20.5f;
c = (float)20.5;
Console.WriteLine("c = " + c);

char d = (char)65;
Console.WriteLine("d = " + d);

Console.ReadLine();


}
}
}

0 意見: