题解 | #班级成绩输入输出#
班级成绩输入输出
https://www.nowcoder.com/practice/60d96b08e1cb42e38629d54e37eac008
public class Program{ public static void Main() { string inPut; while((inPut=System.Console.ReadLine())!=null) { string[] inPutNum = inPut.Split(" ");
//算总分 double total = 0.0; for(int i=0;i<inPutNum.Length;i++) { System.Console.Write(double.Parse(inPutNum[i]).ToString("F1")+" "); total+=double.Parse(inPutNum[i]); } System.Console.WriteLine(total.ToString("F1")); } }
}