package com.hao947; public class hao947 { public static void main(String[] args) { int a = 1; int b = 2; int c = 3; int d = 4; int count = 0; for (int i = 0; i <= 12; i++) { for (int j = 0; j <= 6; j++) { for (int k = 0; k <= 4; k++) { for (int l = 0; l <= 3; l++) { int sum = (a * i + b * j + c * k + d * l); if (sum == 12) { count++; } } } } } System.out.println(count); } }