美文网首页
第十节课第二个作业

第十节课第二个作业

作者: 流影随风 | 来源:发表于2018-12-05 15:09 被阅读0次

 #编码

Console.WriteLine("请输入你的金额");

            double[] money = { 199.9, 250.5, 300, 499, 100 };

            double zong = 0;

            for (int i = 0; i < money.Length; i++)

            {

                Console.Write("第{0}个金额为:", i + 1);

                money[i] = Convert.ToInt32(Console.ReadLine());

                zong += money[i];

            }

            Console.WriteLine("序号\t金额");

            for (int i = 0; i < money.Length; i++)

            {

                Console.WriteLine("{0}\t{1}",i+1,money[i]);

            }

            Console.WriteLine("总金额为:{0}", zong);

            Console.ReadKey();

 #效果

相关文章

网友评论

      本文标题:第十节课第二个作业

      本文链接:https://www.haomeiwen.com/subject/vofwcqtx.html