C#.NET [英] C#.NET

查看:63
本文介绍了C#.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果x大于y,则为x> y写一个C#语句,否则写y> = x。

Write a C#statement for x>y if x is than y and write y>=x otherwise.

推荐答案

Hi Preet chouhan,

Hi Preet chouhan,

对于您的问题,请尝试以下代码。

For your question, please try the following code.

 Console.WriteLine("Please input x");
            int x =Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("Please input y");
            int y = Convert.ToInt32(Console.ReadLine());
            if (x>y)
            {
                Console.WriteLine("x>y");
                //do the things you want when x>y
            }
            else
            {
                Console.WriteLine("y>=x");
                //do the things you want when y<=x
            }

最好的问候,

温迪,做你想要的事情


这篇关于C#.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆