28人需要多少可乐
2013-12-01 19:30
218 查看
---------------------- <a href="http://edu.csdn.net"target="blank">ASP.Net+Android+IOS开发</a>、<a href="http://edu.csdn.net"target="blank">.Net培训</a>、期待与您交流! ----------------------
public class Kele {
public static void main(String[] args)
{
System.out.println(keLe(28));
System.out.println(keLe(56));
}
public static int keLe(int people)
{
int empty=0;
int kele=0;
for(int x=0;x<people;x++)
{
if (empty!=3){
empty+=1;
kele+=1;}
else if(empty==3)
empty=1;
}
return kele;
}
}
---------------------- <a href="http://edu.csdn.net"target="blank">ASP.Net+Android+IOS开发</a>、<a href="http://edu.csdn.net"target="blank">.Net培训</a>、期待与您交流! ----------------------
相关文章推荐
- 28人买可乐喝,3个可乐瓶盖可以换一瓶可乐,那么要买多少瓶可乐,够28人喝?假如是50人,又需要买多少瓶可乐?
- 28人买可乐喝,3个可乐瓶盖可以换一瓶可乐,那么要买多少瓶可乐,够28人喝?假如是50人,又需要买多少瓶可乐?
- :3个瓶盖可以换一瓶可乐,一共有28个人,要保证每个人一瓶,请问最低需要买多少瓶可乐呢?
- 28人买可乐喝,3个可乐瓶盖可以换一瓶可乐,那么要买多少瓶可乐,够28人喝?假如是50人,又需要买多少瓶可乐?
- 28人买可乐喝,3个可乐瓶盖可以换一瓶可乐,那么要买多少瓶可乐,够28人喝?假如是50人,又需要买多少瓶可乐?
- 28人买可乐喝,3个可乐瓶盖可以换一瓶可乐,那么要买多少瓶可乐,够28人喝?假如是50人,又需要买多少瓶可乐?(解读误区)
- 28人买可乐喝,3个可乐瓶盖可以换一瓶可乐,那么要买多少瓶可乐,够28人喝?
- 28人买可乐喝,3个可乐瓶盖可以换一瓶可乐,那么要买多少瓶可乐
- 给定两个正整数A和B,把A变成B需要几位?也就是说A和B之间的位数有多少个是不同的?
- 老师想知道从某某同学当中,分数最高的是多少,现在请你编程模拟老师的询问。当然,老师有时候需要更新某位同学的成绩.
- 关于做个网站需要多少钱,我是这样回答客户的
- 开发一个微信小程序需要多少钱?
- 【转】如何做好一个网站,你需要知道多少?
- 我们一辈子需要多少异性?
- 维持比特币网络需要花费多少比特币?
- 中小企业做SEO需要多少成本
- 程序员到底需要学习多少东西??
- 优化一个关键词到百度首页需要多少钱
- 需要多少只小白鼠才能在24小时内找到毒药
- SWT/JFace开发需要多少包