美文网首页
C#第九次作业01

C#第九次作业01

作者: 谭叁叁 | 来源:发表于2018-11-21 14:51 被阅读0次

#作业要求

根据输入的数字输出所有加法公式

#程序

namespace ConsoleApplication1

{

    class Program

    {

        static void Main(string[] args)

        {

            Console.WriteLine("请输入数字");

            int a = Convert.ToInt32(Console.ReadLine());

            for (int i = 0; i <= a; i++)

            {

                Console.WriteLine("{0}+{1}={2}", i, a - i, a);

            }

            Console.ReadKey();

        }

    }

}

#效果

C#第九次作业01

相关文章

网友评论

      本文标题:C#第九次作业01

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