using System;
using System.Collections.Generic;using System.Linq;
using System.Text;
namespace 爱你一万年
{
class Program
{
static void Main(string[] args)
{
int year=1,i=0;
Console.WriteLine("请问客官我还有机会吗(y/n)");
do
{
year+=i;
year++;
Console.WriteLine("爱你{0}年",year);
} while (year <10000);
Console.Read();
}
}
}
goto,循环
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace @goto
{
class Program
{
static void Main(string[] args)
{
int year = 1, i = 0;
loop:
Console.WriteLine("爱你{0}年", year);
year += i;
year++;
if (year <=10000) goto loop;
Console.Read();
}
}
}
//