我相信这个一定不是最好的。请各位兄台指教指教。
using System;
class Xunhuan
{
static private long sum;
static private long sumall;
static private long sumallall;
static void Main()
{
Console.WriteLine("Please input the times you want!");
int iRead=int.Parse(Console.ReadLine());
Console.Write("Please input the number");
int iRead2=int.Parse(Console.ReadLine());
for(int i=1;i<=iRead;i++)
{
sum=iRead2+sumall*10;
sumallall+=sum;
Console.WriteLine("Now is"+sum);
if(i<iRead)
{
i++;
sumall=iRead2+sum*10;
sumallall+=sumall;
Console.WriteLine("Now is"+sumall);
}
}
Console.Write("The result is "+sumallall);
}
}