C#中的switch,每个分支都应该以break;结束,break的作用是跳出switch结构。但是,如果某个分支中没有语句,那么也可以不写break;
2016-09-22
using System;
using System.Collections.Generic;
using System.Text;
namespace Test
{
class Program
{
static void Main(string[] args)
{
double d = 2.5;
double x = d + 1;
Console.WriteLine(x);
}
}
}
using System.Collections.Generic;
using System.Text;
namespace Test
{
class Program
{
static void Main(string[] args)
{
double d = 2.5;
double x = d + 1;
Console.WriteLine(x);
}
}
}
2016-09-20