public class Test11 {
public static void main(String[] args) {
method(30);
}
public static void method(int x) {
int count = 0;
for (int i = 1; i <= x; i++) {
if (i%3!=0) {
count++;
}
}
if (x%3==0)
System.out.println(x+"个人需要买"+(count+1)+"瓶coca");
else
System.out.println(x+"个人需要买"+count+"瓶coca");
}
}
public class Test11 {
public static void main(String[] args) {
method(27);
}
public static void method(int x) {
int count = 0;
for (int i = 1; i <= x; i++) {
if ((i)%3!=0) {
count++;
}
}
System.out.println(x+"个人需要买"+count+"瓶coca");
}
}