美文网首页
第九次作业/1

第九次作业/1

作者: 爱喝洗脚水 | 来源:发表于2018-11-21 15:07 被阅读0次

    代码图

    .

    效果图

    .

    代码

    static void Main(string[] args)

            {

                int i;

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

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

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

                {

                    if (i + (a - i) == a)

                    {

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

                    }

                }

                Console.ReadKey();

            }

    相关文章

      网友评论

          本文标题:第九次作业/1

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