• c#学习笔记


    下学期要跟着另一伙人去做kinect了,用的是c#,这个假期学学~

    //这个和python import导入包是类似的,using system基本上都是要用到的
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    
    namespace css_l2
    {
        class Program
        {
            static void Main(string[] args)
            {
                //基本的数据类型
                //int 4个字节 long是8个字节 char是一个Unicode字符,可以存数0-65535之间的整数
                //bool布尔类型的  string是一组字符 字符串
                //变量的命名 不能是数字开头  大小写的形式慢慢的去适应吧
                string comparison;
                Console.WriteLine("Enter a number:");
                //类型转换:用户ReadLine进来的就字符串  使用的时候去convert
                //Convert.To...()
                double var1 = Convert.ToDouble(Console.ReadLine());
                Console.WriteLine("Enter another number:");
                double var2 = Convert.ToDouble(Console.ReadLine());
                //if语句记住只能接受bool   比如int num = 0; if (num)之类的都不行的  要if(num != 0)
                if(var1 < var2)
                {
                    comparison = "less than";
                }
                else
                {
                    if(var1 == var2)
                    {
                        comparison = "equal";
                    }
                    else
                    {
                        comparison = "greater than";
                    }
                }
                //{0}, {1}之类的就是占位符,用后面的变量的值来代替
                Console.WriteLine("The first number is {0} the second number.", comparison);
                Console.ReadKey();
            }
        }
    }
  • 相关阅读:
    异步请求模板和数据
    关于线上js报错问题的思考
    标准web浏览器的组件
    监控图片加载的方法
    图片轮播
    jQuery的一些小技巧()
    setTimeout/setInterval伪异步
    linux/windows java jdk环境配置
    iOS pod 第三方 unrecognized selector sent to instance
    上海4
  • 原文地址:https://www.cnblogs.com/virusdefender/p/3559598.html
Copyright © 2020-2023  润新知