- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace test1
- {
- struct phonebook{
- public string name;
- public string phone;
- public string address;
- }
- enum season {spring , summer,autumn,winter};
- class Program
- {
- static void Main(string[] args)
- {
- //
- Console.WriteLine("整数类型");
- Console.WriteLine("the sbyte : " + sbyte.MaxValue + " and " + sbyte.MinValue);
- Console.WriteLine("the short :" + short.MaxValue + " and " + short.MinValue);
- Console.WriteLine("the int :" + int.MaxValue + "and "+ int.MinValue );
- Console.WriteLine("the byte :" + byte.MaxValue +"and "+ byte.MinValue);
- Console.WriteLine("the ushort:" + ushort.MaxValue +"and "+ ushort.MinValue);
- Console.WriteLine("the uint :"+ uint.MaxValue+" and " + uint.MinValue);
- Console.WriteLine("the ulong :"+ulong.MaxValue+ " and "+ulong.MinValue);
- //
- Console.WriteLine("浮点类型");
- Console.WriteLine("the float :"+ float.MaxValue +" and "+ float.MinValue);
- Console.WriteLine("the double" +double.MaxValue+ " and "+ double.MinValue);
- Console.WriteLine("十进制类型");
- Console.WriteLine("the decimal :" + decimal.MaxValue + " and " + decimal.MinValue);
- Console.WriteLine("布尔类型");
- Console.WriteLine("the bool :" + bool.FalseString+" and " + bool.TrueString);
- Console.WriteLine("字符类型");
- Console.WriteLine("位数为16/t,取值范围:在0和65535之间以双字节编码的任意字符");
- Console.WriteLine("枚举类型");
- int s = (int)season.spring;
- int s1 = (int)season.summer;
- int s2 = (int)season.autumn;
- int s3 = (int)season.winter;
- Console.WriteLine("enum season {spring , summer,autumn,winter};");
- Console.WriteLine("season.spring is :" + s);
- Console.WriteLine("season.summer is :" + s1);
- Console.WriteLine("season.autumn is :" + s2);
- Console.WriteLine("season.winter is :" + s3);
- //
- Console.WriteLine("结构类型");
- phonebook pb;
- pb.name = "mike";
- pb.phone = "135769478**";
- pb.address = "NanChang";
- Console.WriteLine(pb.name +"/t"+ pb.phone+"/t"+pb.address);
- /
- }
- }
- }