控制台应用程序的代码 [英] code for console application

查看:99
本文介绍了控制台应用程序的代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果一个人x向公司支付RS1000 / - 如果x加入3个人说x1,x2,x3这三个人每个人向公司支付1000,那么x将获得该金额的10%。然后x1加入另一个3名成员说x4,x5,x6现在他们也向公司支付1000,然后x1将获得该金额的10%(即x4,x5,x6)。然后x将获得x1金额的10%。喜欢这个过程会继续。我为第一个人做这个会得到多少钱。

------------------------ -------------------------------------------------- --------------------------------------

static void main( )

{

Console.writeline(输入no.of levels);

Int l = convert.toint32(console.readline( ));

双和= 0;

For(int i = 1; i< = l; i ++)

{

Double a = math.pow(3,i);

Double b = math.pow(10,i);

Double value = 1000 * (a / b);

总和=总和+值;

}

Console.writeline(结果是+总和);

Console.readline();

}

-------------------- -------------------------------------------------- -----------------------------------------

但是我想在每个级别每个人都会得到多少钱

If a person x pays RS1000/- to a company.If x joins 3 persons say x1,x2,x3 these 3 persons each person pay 1000 to the company then x will get 10% of that amount.Then x1 joins another 3 members say x4,x5,x6 now also they pay 1000 to company then x1 will get 10% of that amount(i.e x4,x5,x6).then x will get 10% of x1 amount. like this process will continue.I do this for first person will get how much money.
----------------------------------------------------------------------------------------------------------------
static void main()
{
Console.writeline("enter no.of levels");
Int l=convert.toint32(console.readline());
Double sum=0;
For(int i=1;i<=l;i++)
{
Double a=math.pow(3,i);
Double b=math.pow(10,i);
Double value=1000*(a/b);
Sum=sum+value;
}
Console.writeline("Result is "+sum);
Console.readline();
}
---------------------------------------------------------------------------------------------------------------
But i want at each level each person will get how much money

推荐答案

我们不做你的功课:这是有原因的。它就是为了让你思考你被告知的事情,并试着理解它。它也在那里,以便您的导师可以识别您身体虚弱的区域,并将更多的注意力集中在补救措施上。



亲自尝试,你可能会发现它不是和你想的一样困难!



如果遇到具体问题,请询问相关问题,我们会尽力提供帮助。但我们不打算为你做这一切!
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think!

If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!


这篇关于控制台应用程序的代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆