1011 A+B 和 C (15 分)

【思路】注意使用long,因为int范围的数字相加a+b有可能会溢出,超过int的最大范围。
import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc= new Scanner(System.in);
        int n= sc.nextInt();//输入数
        for(int i=0; i<n; i++){
            Long A = sc.nextLong();
            Long B = sc.nextLong();
            Long C = sc.nextLong();
            if(A+B > C){
                System.out.println("Case #" + (i+1)+ ": true");
            }else{
                System.out.println("Case #" + (i+1)+": false");
            }
        }
        
    }
}


全部评论

相关推荐

赛博小保安:你这简历没啥大问题的,经历技能也足够了,问题应该就是出在出身了,学院本就是这样,HR忙着跟92的勾搭呢,哪有心思看我们这些双非😿😭
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务