28人需要多少可乐

来源:互联网 发布:hr群发工资条软件 编辑:程序博客网 时间:2024/04/29 23:23

 

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