您的位置:首页 > 其它

1098 -- 计算平均数

2015-08-29 17:22 260 查看
计算平均数
Time Limit:1000MS Memory Limit:65536K

Total Submit:451 Accepted:261
Description
输入三个整数,输出他们的平均数(保留三位小数)

Input
输入三个整数

Output
输出他们的平均数(保留三位小数)

Sample Input
1 2 3

Sample Output
2.000

Source
lrj程序入门

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AK1098 {
class Program {
static void Main(string[] args) {
string[] sb = Console.ReadLine().Split();
double x = double.Parse(sb[0]), y = double.Parse(sb[1]), z = double.Parse(sb[2]);
Console.WriteLine(((x + y + z) / 3).ToString("0.000"));
}
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: