1、暴力破解法
使用四个for循环,但是如果n很大的话,就会超时
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
int[] array = new int[]{
1,2,5,10};
System.out.println(myCount(n, array));
}
public static int myCount(int n,int[] array){
int count=0;
for (int i = 0; i <= n; i++)