解题思路:
注意事项:
参考代码:
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(),x=1,shendu=1,max_shendu=-1; int sum=0,max=Integer.MIN_VALUE; while(x<=n){ sum=0; for(int i=1;i<=Math.pow(2, shendu-1);i++){ int A=sc.nextInt(); sum+=A; x++; if(x>n) break; } if(max<sum){ max=sum; max_shendu=shendu; } shendu++; } System.out.print(max_shendu); } }
0.0分
0 人评分
IP判断 (C++代码)浏览:677 |
C语言程序设计教程(第三版)课后习题7.5 (C语言代码)浏览:583 |
C语言考试练习题_保留字母 (C语言代码)浏览:569 |
C语言程序设计教程(第三版)课后习题5.4 (C语言代码)浏览:659 |
C语言训练-求1+2!+3!+...+N!的和 (C语言代码)浏览:536 |
【亲和数】 (C语言代码)浏览:541 |
【绝对值排序】 (C语言代码)浏览:714 |
Pascal三角 (C语言代码)格式错误浏览:520 |
简单的a+b (C语言代码)浏览:335 |
C语言程序设计教程(第三版)课后习题5.7 (C语言代码)浏览:1154 |