using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace 水汐
{
class Program
{
static void Main(string[] args)
{
string s = Console.ReadLine();
int a = Convert.ToInt32(s);
s = Console.ReadLine();
int b = Convert.ToInt32(s);
int c = a + b;
Console.WriteLine("{0}",a+b);
Console.WriteLine(a + b);
Console.WriteLine(c);
/******************************************************/
string s2 = Console.ReadLine();
string[] ss2 = s2.Split(' ');
double[] a = new double[ss2.Length];
double sum = 0;
for (int i = 0; i < ss2.Length; i++)
{
a[i] = Convert.ToDouble(ss2[i]);
sum += a[i];
}
Console.WriteLine(sum);
}
}
}
【水汐のC#控制台】输入和输出
最新推荐文章于 2021-05-22 22:02:46 发布