您的位置:首页 > 其它

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>、期待与您交流! ----------------------

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐