C# 简单的特殊输出

时间:2014-05-11 22:28:49   收藏:0   阅读:298

   

    class Program
    {
        static void Main(string[] args)
        {
            int i = 940;
            int j = 73;
            Console.WriteLine("{0,5}\n+{1,4}\n------\n{2,4}",i,j,i+j);

 

            decimal a1 = 940.23m;
            decimal a2 = 73.7m;
            Console.WriteLine("{0,9:C2}\n+{1,9:C2}\n-----\n{2,9:C2}",a1,a2,a1+a2);


            Console.ReadKey();
        }
    }

输出结果为:bubuko.com,布布扣

 

 

 

C# 简单的特殊输出,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!