package org.pie.audition;
import java.util.Scanner;
public class Test10 {
/**
* 10.28人买可乐喝,3个可乐瓶盖可以换一瓶可乐,那么要买多少瓶可乐,够28人喝?
* 假如是50人,又需要买多少瓶可乐?
*/
public static void main(String[] args) {
//while(true){
System.out.println("输入");
int he = new Scanner(System.in).nextInt();
int kong = 0,mai = 0;
while(he > 0) {
if(kong == 3) {
kong = 1;
he--;
continue;
}
//if((mai+1) % 3 != 0) {
else{
mai++;
kong++;
he--;
}
}
System.out.println(he);
System.out.println(mai);
System.out.println(kong);
}
}
|