使用#region和#endregion关键字,来定义可以展开折叠的代码区域的开头和结尾。
类型 |
别名 |
允许的值 |
sbyte |
System.SByte |
在-128~127之间的整数 |
byte |
System.Byte |
在0~255之间的整数 |
short |
Syetem.Int16 |
在-32768~32767之间的整数 |
ushort |
System.Uint16 |
在0~65535之间的整数 |
int |
System.Int32 |
在-2147483648~2147483647之间的整数 |
uint |
System.UInt32 |
在0~4294967295间的整数 |
long |
System.Int64 |
在-9223372036854775808~9223372036854775807之间的整数 |
ulong |
System.UInt64 |
在0~18446744073709551615之间的整数 |
|
|
|
类型 |
别名 |
m的最小值 |
m的最大值 |
e的最小值 |
e的最大值 |
float |
System.Single |
0 |
224 |
-149 |
104 |
double |
System.Double |
0 |
253 |
-1075 |
970 |
decimal |
System.Decimal |
0 |
296 |
-26 |
0 |
类型 |
别名 |
允许的值 |
char |
System.Char |
一个Unicode字符,存储0~65535之间的整数 |
bool |
System.Boollean |
布尔值:true或false |
string |
System.String |
一组字符 |
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication2
{
class Program
{
static void Main(string[] args)
{
double Done, Dtwo;
string userName;
Console.WriteLine("Enter your name:"); //提示输入内容
userName = Console.ReadLine(); //把内容保存到string变量userName
Console.WriteLine("Welcome {0}!",userName);
Console.WriteLine("Now give me a number:");
//把输入的内容转换为double型
Done = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("Now give me a number:");
Dtwo = Convert.ToDouble(Console.ReadLine());
Console.WriteLine("The sum of {0} and {1} is {2}.", Done, Dtwo, Done + Dtwo);
Console.WriteLine("The result of subtracting {0} from {1} is {2}.", Dtwo, Done, Done - Dtwo);
Console.ReadKey();
}
}
}