首页 > 编程语言 >C#学习笔记——入门

C#学习笔记——入门

时间:2024-08-14 09:06:41浏览次数:7  
标签:语句 入门 C# 笔记 运算符 int 类型 string 变量

<div id="article_content" class="article_content clearfix">         <link rel="stylesheet" href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/editerView/kdoc_html_views-1a98987dfd.css">         <link rel="stylesheet" href="https://csdnimg.cn/release/blogv2/dist/mdeditor/css/editerView/ck_htmledit_views-044f2cf1dc.css">                               <div id="content_views" class="markdown_views prism-tomorrow-night">                     <svg xmlns="http://www.w3.org/2000/svg" style="display: none;">                         <path stroke-linecap="round" d="M5,0 0,2.5 5,5z" id="raphael-marker-block" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></path>                     </svg>                     <p></p>  <div class="toc">   <h4><a name="t0"></a><a href="https://so.csdn.net/so/search?q=Unity&amp;spm=1001.2101.3001.7020" target="" class="hl hl-1" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.7020&quot;,&quot;dest&quot;:&quot;https://so.csdn.net/so/search?q=Unity&amp;spm=1001.2101.3001.7020&quot;,&quot;extra&quot;:&quot;{\&quot;searchword\&quot;:\&quot;Unity\&quot;}&quot;}" data-tit="Unity" data-pretit="unity">Unity</a>学习笔记(零基础到就业)|Chapter01:C#入门</h4>   <ul><li><a href="#_7" rel="nofollow" target="_self">前言</a></li><li><a href="#_14" rel="nofollow" target="_self">一、控制台输入输出语句</a></li><li><a href="#_20" rel="nofollow" target="_self">二、初识变量</a></li><li><ul><li><a href="#1tips_21" rel="nofollow" target="_self">1.一些好用的tips</a></li><li><a href="#2_57" rel="nofollow" target="_self">2.变量声明的固定写法</a></li><li><a href="#3_69" rel="nofollow" target="_self">3.变量类型</a></li></ul>    </li><li><a href="#_71" rel="nofollow" target="_self">三、变量的本质</a></li><li><ul><li><a href="#1_72" rel="nofollow" target="_self">1.变量的存储空间</a></li><li><a href="#22_78" rel="nofollow" target="_self">2.变量的本质:2进制</a></li></ul>    </li><li><a href="#_88" rel="nofollow" target="_self">四、变量的命名规范</a></li><li><ul><li><a href="#1_89" rel="nofollow" target="_self">1.必须遵守的规则</a></li><li><a href="#2_91" rel="nofollow" target="_self">2.常用命名规范</a></li></ul>    </li><li><a href="#_99" rel="nofollow" target="_self">五、常量</a></li><li><ul><li><a href="#1_100" rel="nofollow" target="_self">1.常量的声明</a></li><li><a href="#2_103" rel="nofollow" target="_self">2.常量的特点</a></li></ul>    </li><li><a href="#_105" rel="nofollow" target="_self">六、转义字符</a></li><li><ul><li><a href="#1_106" rel="nofollow" target="_self">1.转义字符的使用</a></li><li><a href="#2_109" rel="nofollow" target="_self">2.取消转义字符</a></li></ul>    </li><li><a href="#_112" rel="nofollow" target="_self">七、类型转换(不同变量类型之间的相互转换)</a></li><li><ul><li><a href="#1_113" rel="nofollow" target="_self">1.隐式转换</a></li><li><ul><li><a href="#1_115" rel="nofollow" target="_self">(1)相同大类型之间的转换规则</a></li><li><a href="#2_126" rel="nofollow" target="_self">(2)不同大类型之间的转换规则</a></li></ul>     </li><li><a href="#2_134" rel="nofollow" target="_self">2.显式转换</a></li><li><ul><li><a href="#1_136" rel="nofollow" target="_self">(1)括号强转</a></li><li><a href="#2Parse_139" rel="nofollow" target="_self">(2)Parse法</a></li><li><a href="#3Convert_148" rel="nofollow" target="_self">(3)Convert法</a></li><li><a href="#4stringToString_161" rel="nofollow" target="_self">(4)其他类型转string(ToString)</a></li></ul>    </li></ul>    </li><li><a href="#_176" rel="nofollow" target="_self">八、异常捕获</a></li><li><a href="#_195" rel="nofollow" target="_self">九、运算符</a></li><li><ul><li><a href="#1_196" rel="nofollow" target="_self">1.算数运算符</a></li><li><a href="#2_207" rel="nofollow" target="_self">2.字符串拼接</a></li><li><a href="#3_235" rel="nofollow" target="_self">3.条件运算符</a></li><li><a href="#4_245" rel="nofollow" target="_self">4.逻辑运算符</a></li><li><a href="#5_251" rel="nofollow" target="_self">5.位运算符</a></li><li><a href="#6_279" rel="nofollow" target="_self">6.三目运算符</a></li></ul>    </li><li><a href="#_294" rel="nofollow" target="_self">十、条件分支语句</a></li><li><ul><li><a href="#1if_295" rel="nofollow" target="_self">1.if</a></li><li><ul><li><a href="#1if_301" rel="nofollow" target="_self">(1)if语句</a></li><li><a href="#2if_else_311" rel="nofollow" target="_self">(2)if else语句</a></li><li><a href="#3if_else_if_else_323" rel="nofollow" target="_self">(3)if else if else语句</a></li></ul>     </li><li><a href="#2Switch_338" rel="nofollow" target="_self">2.Switch</a></li></ul>    </li><li><a href="#_379" rel="nofollow" target="_self">十一、循环语句</a></li><li><ul><li><a href="#1while_380" rel="nofollow" target="_self">1.while</a></li><li><a href="#2do_while_405" rel="nofollow" target="_self">2.do while</a></li><li><a href="#3for_416" rel="nofollow" target="_self">3.for</a></li><li><a href="#4foreach_447" rel="nofollow" target="_self">4.foreach</a></li></ul>    </li><li><a href="#_460" rel="nofollow" target="_self">总结</a></li></ul>  </div>  <p></p>  <hr>  <h2><a name="t1"></a><a id="_7"></a>前言</h2>  <p>游戏作为一种情感表达的载体,在让玩家感到有趣和感动的同时,也建立了人与人之间的链接,我想看看更多在不同意识形态和文化背景下的知识的碰撞和思想的迸发,所以开始了<a href="https://so.csdn.net/so/search?q=%E6%B8%B8%E6%88%8F%E5%BC%80%E5%8F%91&amp;spm=1001.2101.3001.7020" target="_blank" class="hl hl-1" data-report-view="{&quot;spm&quot;:&quot;1001.2101.3001.7020&quot;,&quot;dest&quot;:&quot;https://so.csdn.net/so/search?q=%E6%B8%B8%E6%88%8F%E5%BC%80%E5%8F%91&amp;spm=1001.2101.3001.7020&quot;,&quot;extra&quot;:&quot;{\&quot;searchword\&quot;:\&quot;游戏开发\&quot;}&quot;}" data-report-click="{&quot;spm&quot;:&quot;1001.2101.3001.7020&quot;,&quot;dest&quot;:&quot;https://so.csdn.net/so/search?q=%E6%B8%B8%E6%88%8F%E5%BC%80%E5%8F%91&amp;spm=1001.2101.3001.7020&quot;,&quot;extra&quot;:&quot;{\&quot;searchword\&quot;:\&quot;游戏开发\&quot;}&quot;}" data-tit="游戏开发" data-pretit="游戏开发">游戏开发</a>的自学之路,人生就这一次,就这么几十年,喜欢什么想要尝试什么咱就去做吧~</p>  <p><code>这系列的学习笔记主要是根据唐老狮的unity实战路线课程整理的,加入了自己的一些补充和理解,该课程涉及的知识内容非常多,我并未学完,而是根据就业需求挑选学习的,也对后续框架部分进行了一些修改,希望能通过整理并时常阅读这些笔记巩固开发知识,也希望能跟在学习unity的小伙伴一起分享、探讨,笔记中有疑问或出错的部分也希望大佬们能够给予指导鸭~

标签:语句,入门,C#,笔记,运算符,int,类型,string,变量
From: https://www.cnblogs.com/yutian-blogs/p/18358134

相关文章

  • 精密Δ-Σ ADC的有效噪声带宽
    1简介        即使对最有经验的模拟设计工程师来说,理解ADC噪声也是一项挑战。Δ-ΣADC具有量化噪声和热噪声,其变化取决于ADC的分辨率、参考电压和输出数据速率。在系统层面上,噪声分析因附加的信号链组件而变得更加复杂,这些组件中的许多具有不同的噪声特性,使得它们很......
  • 会议活动拍摄人物技巧笔记
    1.签到特写镜头。2.每个在舞台上讲话的全景,半身,特写,全景要带上会议背景板主题等元素,注意表情,不要拍成表情包了。3.互动环节和颁奖环节,一定要拍下领导与员工互动的中景镜头。4.多个专注听讲的人特写镜头或者记笔记的镜头。5.合影,一定要记得全部人员要装进去,尽量把被摄者排列整......
  • Δ-Σ ADC选型时噪声性能实例详解
    1系统规格   假设一个灵敏度为2mV/V、激励电压为2.5V的电桥,数据采样率为5SPS。1kg最大施加重量时,最大输出电压为5mV,系统希望能够检测最小应用重量为50mg(电压信号为50/1000000*5mV=250nV)。2无噪声分辨率计算    根据系统需求,可先计算出无噪声计数和无......
  • linux中shell脚本手动执行没有问题,crontab定时执行失败(实测已解决)
    原文链接:https://blog.csdn.net/lukabruce/article/details/93851477问题描述:Shell脚本手动执行可以正常运行,并得到正确结果;使用Crontab定时调度的时候,Shell脚本执行出来的结果数据量为0。原因:Linux下用crontab执行定时任务不会缺省的从用户profile文件中读取环境变量参数,所以......
  • Odin Inspector教程 | (一)开始使用Odin Inspector
    【OdinInspectorandSerializer最新版免费下载地址】前言OdinInspectorandSerializer(以下简称OdinInspector)是一个功能丰富的Unity插件,它主要提供了更强大、更灵活的Inspector面板自定义和序列化解决方案。安装OdinInspector导入包(Importthepac......
  • 如何自学成为一名黑客?(非常详细)零基础入门到精通,收藏这篇就够了
    如何自学成为一名黑客?知道这4点,哪怕新手也能自学成为黑客大佬。第一,准备设备。光有手机是不行的,你得有一台电脑,并且电脑的配置起码得满足这两个条件,不然发起攻击时,目标没崩溃你先崩溃了。第二,熟读网络安全法。技术本身是没有罪的,但行为是可以判刑的,所以在学技术之前一......
  • 高危漏洞CVE-2024-38077的修复指南
    “根据2024年8月9日,国家信息安全漏洞共享平台(CNVD)收录了Windows远程桌面许可服务远程代码执行漏洞(CNVD-2024-34918,对应CVE-2024-38077)。未经身份认证的攻击者可利用漏洞远程执行代码,获取服务器控制权限。目前,该漏洞的部分技术原理和概念验证伪代码已公开,厂商已发布安......
  • CH340一键下载电路
    单片机串口一键下载方案一、概述CH340X/N/K/CH343/CH342等USB转串口芯片可实现不同类型MCU串口一键下载功能,对于支持多模式启动的STM32Fxxx/CH32Fxxx/CH32Vxxx等系列、ESP系列等MCU,使用CH340X、CH343和CH342芯片时无需外围三极管等逻辑控制电路,将芯片提供的输出信号脚直连M......
  • C语言指针(3)
    野指针与空指针:野指针:概念:访问一个已经销毁或者访问受限的内存区域外的指针产生场景:·变量未初始化,通过指针访问该变量                       ·指针变量未初始化                           ·指......
  • Codeforces Round 966 (Div. 3)
    Abstract第二次打CodeForce。A.PrimaryTaskIdea签到题。意思就是说给一个字符串,要你判断一下前两位是不是10,除去前两位后后面的部分是不是一个大于等于2的数(不能有前导零)。Code#include<bits/stdc++.h>usingnamespacestd;voidsolve(){stringtext;......