C#编程语言编写。在线等!!
static void Main(string[] args)
{
//每天给10W 直接计算富人所得
var sumRichGet = 100000.00*30;
//陌生人
var sumStrangerGet = 0.00;
for (int i = 0; i < 30; i++)
{
//先按分计算 最后换算成元 故:
sumStrangerGet += Math.Pow(2, i);
}
Console.WriteLine(string.Format("陌生人获得:{0}元", (sumStrangerGet / 100).ToString("#,##0.00")));
Console.WriteLine(string.Format("富翁 获得:{0}元", sumRichGet.ToString("#,##0.00")));
Console.ReadLine();
}
int sum1=0,sum2=0;
for(int i=0,j=2;i<=30;i++)
{
j=Math.Pow(j,i);
x1=Math.Pow(x1,j);
sum1=sum+x1
}
sum=x2*30;
不会再问我。
调试不正确
long x1 = 1, x2 = 10000000;
long sum1 = 0, sum2 = 0;
for (int i = 0, j = 2; i <= 30; i++)
{
x1 = j*x1;
sum1 = sum1 + x1;
}
sum2 = x2 * 30;
MessageBox.Show(sum1+"和"+sum2);
double sum1 = 0, sum2 = 0;
for (int i = 0; i <= 30; i++)
{
x1 = x1 * 2;
sum1 = sum1 + x1;
}
sum2 = x2*30;