每日一练

每日一练,第1张

每日一练

package cn.itcast.girl.TheBlueCup_02;

import java.util.Scanner;

public class Unhappy {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        Scanner sc = new Scanner(System.in);
        int q[] = new int[7];

        int a,b;
        int max = Integer.MIN_VALUE,flag=0;
        for(int i=0;i<7;i++) {
            a = sc.nextInt();
            b = sc.nextInt();
            q[i] = a+b;
            if(q[i]>8 && q[i]>max) {
                max=q[i];
                flag = i+1;
            }
            
        }
        System.out.println(flag);
        sc.close();
    }

}
 

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5710175.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存