用c#编写一个程序来解决一个问题。 [英] Write a program in c# to solve a problam.

查看:64
本文介绍了用c#编写一个程序来解决一个问题。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想编写这样的程序以满足以下条件



我希望在4人中分为52张卡这样一种方式每个人都可以通过增加2来获得卡第一个获得2张牌第二个4第三个6和第四个8.现在第一个应该获得10个等等。只要在那种情况下无法增加2张牌就可以使用所有剩余的牌都应该与转弯的人相对应。



在数学上, ,,,

让A,B,C,D为4人



在第一轮获得所有奖金



A-2

B-4

C-6

D-8然后剩下的卡是52-(2 + 4 + 6 + 8)= 32



现在在第二轮



A-10

B-12现在剩下的牌是32-(10 + 12)= 10所以2张牌的增量是不可能的,因为C应该得到14张牌......这就是为什么.. .10卡分配给c

C-10



请给出合适的解决方案。

谢谢

I want to write such a program to satisfied as following condition

I want divided 52 card in 4 persons such a manner everyone get the card by increment of 2.First one get 2 cards second 4 third 6 and fourth 8.now first should get 10 and so on. It will go till that whenever the increment of 2 card is not possible in that condition all remaining card should be attoted to the person which is have turn.

Methematically,,,,,
Let A,B,C,D are 4 persons

In First Round card getting by all

A-2
B-4
C-6
D-8 Then remaining card are 52-(2+4+6+8)=32

Now in second round

A-10
B-12 now remaining cards are 32-(10+12)=10 so increment of 2 cards is not possible because C should get 14 cards.....thats why....10 cards alloted to c
C-10

plz give appropriate solution.
Thank You

推荐答案

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



亲自尝试,你可能会发现它不是和你想的一样困难!
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!


这篇关于用c#编写一个程序来解决一个问题。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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