2个整数A B,中间用空格分割。(0 <= A, B <= 10^9)输出A + B的计算结果。-------------------------------------------------------------------------using System; using System.IO; using System.Numerics; public class Sum { public static void Main() { StreamReader sr = new StreamReader(Console.OpenStandardInput()); StreamWriter sw = new StreamWriter(Console.OpenStandardOutput()); string[] s = sr.ReadLine().Split(' '); sw.WriteLine(BigInteger.Parse(s[0]) + BigInteger.Parse(s[1])); sr.Close(); sw.Close(); } }
用C#求A+B A,B在同一行输入,之间用空格隔开
最新推荐文章于 2021-05-18 04:57:46 发布
本文介绍了一个简单的C#程序,该程序使用BigInteger类来处理两个大整数的加法运算,并展示了如何读取标准输入及输出计算结果。
949

被折叠的 条评论
为什么被折叠?



