【无标题】Java读取两个整数并求和 //Read two integer and display sum

该程序从键盘接收两个整数N1和N2,计算它们的和,并在控制台显示结果。考虑到输入可能超出int范围,使用long类型以确保所有可能的整数组合都能被正确处理。
摘要由CSDN通过智能技术生成

Tags: Input/OutputArithmetic Calculations //输入/输出算术计算
Given two integer numbers, display the sum of those numbers.
给定两个整数,显示他们的总和。

Write a program:
that read two integers from the keyboard and display sum of those numbers.
从键盘读取两个整数并显示这些数字的总和。

First line contains integer N1.
Second line contains integer N2.

Assume that,

Input contains N1 and N2 integer numbers within the range [-2,147,483,648 to 2,147,483,647].
//此范围为long类型数据范围
//int范围 [-2147483648,214748364],如用int定义,则有一部分数据无法显示

Input

153

12

Output

165
public static void main (
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值