1 Star 0 Fork 50

袁国猛/C_sharp面向对象笔记

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
01.txt 1.98 KB
一键复制 编辑 原始数据 按行查看 历史
王文莉 提交于 2022-04-17 22:35 +08:00 . 笔记
//输出
//Console.Write("");//不换行 print
//Console.WriteLine("Hello World!");//自动换行 println
//Console.ReadLine();
//变量
//有符号(-32100,),
short b = -32768;//-32768-32767
//无符号(0 -)
//ushort b2 = 65000;
//String 类,
//数据类型:整型,单精度float,双精度double,字符char,bool,string,decimal
//运算符
//算数:+,-,/,%
////赋值:=,+=,-=,*=,/=,%=
//var a1= 1.0M;
//Type a1_type = a1.GetType();
//Console.WriteLine(a1_type);
//比较,逻辑:>,<,>=,<=,!=,==, &&, ||, !
//&&: true && true --> true
//|| : false || false --> false
//短路与: && false && true(false) --> false
//短路或:|| true || true(false) --> true
//bool b3 = c > c1 && c++ < c1;
//Console.WriteLine(c);
//三元 ?: (条件表达式-->true,false)?(true):(false)
//int max = (c > c1) ? c : c1;
//Console.WriteLine(max);
////求三个数的最大值
//int max1 = c > c1 ?(c>c2?c:c2) : (c1>c2?c1:c2) ;
//Console.WriteLine(max1);
//循环结构
//1.while()
//2.for(; ; )
//3.foreach()
//四要素:初始值 判断条件 循环体 迭代因子
//1+...+10
//int i = 1;
int sum = 0;
//知道退出条件,不知道循环次数
//while (i<=10)
//{
// sum = sum + i;
// i++; //迭代因子
//}
//Console.WriteLine("sum{0}", sum);
//for(int i = 1; i <= 10; i++)
//{
// sum = sum + i;
//}
//Console.WriteLine("sum{0}", sum);
//3.foreach
//统计输入的字符串,有几个字母,几个数字,几个特殊符号
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/guomeng12/c-sharp-object-oriented-notes.git
git@gitee.com:guomeng12/c-sharp-object-oriented-notes.git
guomeng12
c-sharp-object-oriented-notes
C_sharp面向对象笔记
master

搜索帮助