题解 | #百钱买百鸡问题#
百钱买百鸡问题
http://www.nowcoder.com/practice/74c493f094304ea2bda37d0dc40dc85b
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
for(int i = 0; i<=20; i++){
for(int j =0; j<34; j++){
int k = 100-i-j;
if((5*i + 3*j + k/3 == 100) && k%3 == 0){
System.out.println(i+" "+j+" "+k);
}
}
}
}
}