为了账号安全,请及时绑定邮箱和手机立即绑定

C#开发轻松入门

难度入门
时长 4小时43分
学习人数
综合评分9.40
828人评价 查看评价
9.5 内容实用
9.5 简洁易懂
9.2 逻辑清晰
  • 代码供参考:

    using System;
    using System.Collections.Generic;
    using System.Text;
    
    namespace Test
    {
        class Program
        {
            static void Main(string[] args)
            {
                int y = 5;
                while (y > 0)//请输入
                {
                    Console.Write(y+" ");
                    y--;//请输入
                }
            }
        }
    }
    查看全部
  • using System;
    using System.Collections.Generic;
    using System.Text;
    
    namespace Test
    {
        class Program
        {
            static void Main(string[] args)
            {
                int x=1;
                bool a = ++x * x > 3;//true x=1 运行后x=2,2 * 2 = 4 >3
                bool b = x>1 ;//请赋值
                Console.WriteLine(a==b);
            }
        }
    }
    查看全部
  • using System;

    using System.Collections.Generic;

    using System.Text;


    namespace Test

    {

        class Program

        {

            static void Main(string[] args)

            {

                double x, y;

                x = y = 2;//从右向左赋值,x、y的值都是2

                x /= 0.5;//x=x/0.5 x=4

                y = 0;

                Console.WriteLine(x-y);

            }

        }

    }


    查看全部
  • 双精度浮点型 double ,存储小数,例如:

    查看全部
    0 采集 收起 来源:C#的数据类型

    2023-05-07

  • 整数类型 int ,存储整数,例如

    查看全部
    0 采集 收起 来源:C#的数据类型

    2023-05-07

  • 字符串类型 string ,存储用“”(双引号)括起来的一串字符,例如:

    查看全部
    0 采集 收起 来源:C#的数据类型

    2023-05-07

  • 字符类型 char ,存储用 '' (单引号)括起来的一个字符,例如:

    查看全部
    0 采集 收起 来源:C#的数据类型

    2023-05-07

  • using System;
    using System.Collections.Generic;
    using System.Text;
    
    namespace Test
    {
        class Program
        {
            static void Main(string[] args)
            {
                double x = 3.5;
                int y = 3;
                Console.WriteLine((double)x>y);
            }
        }
    }
    查看全部
  • 需要申明变量 string temp;

    查看全部
    0 采集 收起 来源:编程练习

    2023-04-22

  • double 型强制转换为int型将失去小数部分,比如(int)2.8,我们得到的将是2。
    查看全部
    0 采集 收起 来源:C#的类型转换

    2023-04-13

  • 2个条件都是“必须”做到,那就需要同时满足,适合用逻辑与(&&)连接:

    || 二者居其一即可

    查看全部
  • ! 取反   即“真变假”或“假变真”

    && 一票否决   只有当&&两边的表达式均为 true 时,整个表达式才为 true ;若任意一个表达式为 false ,整个表达式即为 false 。

    ||一票表决   只有当&&两边的表达式均为 true 时,整个表达式才为 true ;若任意一个表达式为 false ,整个表达式即为 false 。

    查看全部
  • 641fce050001321610520780.jpg1111111111
    查看全部
    0 采集 收起 来源:编程练习

    2023-03-26

  • namespace Test

    {

        class Program

        {

            static void Main(string[] args)

            {

                 char sex = '男';

                  int age = 21;

                  if (sex == '女')

                  {

                        if(age >= 20)

                        {

                            Console.WriteLine("达到法定年龄");

                        }

                        else

                        {

                            Console.WriteLine("没有达到呦");

                         }

                    }

                    else

                    {

                        if(age >= 22)

                        {

                            Console.WriteLine("达到法定年龄");

                        }

                        else

                        {

                            Console.WriteLine("没有达到!");

                        }

                    }

            }

        }

    }

    查看全部
  • namespace Test

    {

        class Program

        {

            static void Main(string[] args)

            {

                double x = 13.9, y = 24.4;

                double sum = x + y ;

                double avg = sum /2;

                Console.WriteLine(avg);

            }

        }

    }

    查看全部

举报

0/150
提交
取消
课程须知
本课程是C#基础课程,热烈欢迎各位小伙伴拍砖吐槽!!
老师告诉你能学到什么?
1、C#的基本概念 2、Visual Studio的使用技巧 3、C#的语法和程序逻辑

微信扫码,参与3人拼团

意见反馈 帮助中心 APP下载
官方微信
友情提示:

您好,此课程属于迁移课程,您已购买该课程,无需重复购买,感谢您对慕课网的支持!