201301 JAVA题目0-1级, 华为笔试题

2021-04-30 19:28

阅读:535

标签:while   ==   tin   system   sum   ring   string   for   res   


import java.util.*;
public class Main {
    static boolean dfs(List list, int sum3, int sum5, int u) {
        if(u == list.size()) {
            return sum3 == sum5;
        } 
        return dfs(list, sum3+list.get(u), sum5, u+1) || dfs(list, sum3, sum5+list.get(u), u+1);
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()) {
            int n = sc.nextInt();
            int[] a = new int[n];
            int sum3 = 0, sum5 = 0;
            List list = new ArrayList();
            for(int i=0; i 

201301 JAVA题目0-1级, 华为笔试题

标签:while   ==   tin   system   sum   ring   string   for   res   

原文地址:https://www.cnblogs.com/lixyuan/p/13226575.html


评论


亲,登录后才可以留言!