把2019分解成3个各不相同的正整数之和,并且要求每个正整数都不包
含数字2和4,一共有多少种不同的分解方法?
public class Decomposition {
public static void main(String[] args) {
String str;
int count = 0;
int n = 0;
for (int i = 1; i < 2019; i++) {
for (int j = i + 1; j < 2019; j++) {
int k = 2019 - i - j;
if ((i != k) && (j != k) && k > 0) {
str = "" + i + j + k;
n++;
if (str.contains("2") || str.contains("4")) {
count++;
}
}
}
}
System.out.println((n - count) / 3);
}
}