课堂上老师讲了几点,自己觉得挺重要的,记录下来

1、代码字体调大,方便调试

2、虚心请教,没有谁比谁厉害,不会就虚心多请教,baidu并不能解决所有问题。沟通交流也是一种能力

3、只有每行写对了,才继续往下写,写的时候必须善用“Tab”键。

4、多写笔记,善于利用“便签”,“时间管理”

1、代码自动缩进


2、选择结构

a、if …… else if …… else

if()
{
.........
}
else if()
{
.........
}
else()
{
.........
}

b、switch 语句

 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text; namespace MyProject
{
class Program
{
static void Main(string[] args)
{
// 提示词是得分点
Console.WriteLine("请输入一个数字"); // Parse , 语句嵌套 实现 输入数字 赋给 x
int x = int.Parse(Console.ReadLine()); // 注意不能直接定义而不给初始值
string res = "";
//Console.WriteLine(x); if( x < || x > )
{
Console.WriteLine("您输入的数字不合法");
}
else
{
switch (x / )
{
case :
case : res = "A"; break;
case : res = "B"; break;
case : res = "C"; break;
case : res = "D"; break;
default: res = "E";break;
}
Console.WriteLine("{0}的等级为:{1}",x,res);
}
}
}
}

Array类的使用,以及Random类的使用

 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text; namespace MyProject
{
class Program
{
static void Main(string[] args)
{
// 随机数,Random , 系统提供类
Random R = new Random();
int[] a = new int[];
for( int i = ; i < ; i++)
{
// Next 返回一个 Next( Int32 ) -> 随机生成小于 101 非负整数。
// Next ( L , R ) 随机生成 [L,R)里面的整数的
a[i] = R.Next();
//a[i] = R.Next(1, 3);
if ((i + ) % == ) Console.WriteLine() ;
} // foreach -> 针对里面赋值了的元素进行输出
foreach (var item in a )
{
Console.Write( "{0}\t",item );
}
Console.WriteLine( "\n______________" );
Console.WriteLine(); // Array 类自带排序
Array.Sort(a);
foreach (var item in a)
{
Console.Write("{0}\t", item);
}
Console.WriteLine("\n______________");
Console.WriteLine(); // Array 数组的逆置
Array.Reverse(a);
foreach (var item in a)
{
Console.Write("{0}\t", item);
} //[,] 加逗号划分维度
int[,] B = new int[, ]; Console.WriteLine("\n_______________"); //返回整个数组的大小
Console.WriteLine( B.Length ); //返回数组的维度
Console.WriteLine( B.Rank ); //返回数组 两个不同维度的长度
Console.WriteLine( B.GetLength() );
Console.WriteLine( B.GetLength() );
}
}
}

String 类的Split使用

 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text; namespace MyProject
{
class Program
{
static void Main(string[] args)
{
string s = "1 2 3 4 , 5 ,6 7 . 5 4";
char[] t = new char[] { ',', '.', ' ' };
string[] str1 = s.Split( t , StringSplitOptions.RemoveEmptyEntries);
string[] str2 = s.Split( new char[] { ',','.',' '} , StringSplitOptions.RemoveEmptyEntries);
foreach (var item in str1 )
{
Console.WriteLine("{0}",item);
}
}
}
}

【C#】课堂知识点#2的更多相关文章

  1. C++ 大学课堂知识点总结

    一.从C到C++1.引用int b;int &a = b;//a是引用类型       定义的时候加&  表示引用   其余都是取地址  a是b别名 使用a和使用b是一样的  主要用于 ...

  2. 【C#】课堂知识点#4

    1.回顾类中基本结构. 成员分为: a.(数据成员) , b.(方法成员) 数据成员: 字段 方法成员:方法,构造函数,属性,索引器,运算符. 属性的作用: 对字段进行访问提供get,set方法. 类 ...

  3. 【C#】课堂知识点#3

    1.讲解了实验1中,利用Char.is***来进行判断字符类型. using System; using System.Collections.Generic; using System.Linq; ...

  4. 【C#】课堂知识点#1

    标准数字格式字符串 https://docs.microsoft.com/zh-cn/dotnet/standard/base-types/standard-numeric-format-string ...

  5. Html----开头

     Html开头 *<meta http-equiv='content-type' content='text/html;charset=utf-8'>*定义字符编码,这是必须有的 后另存为 ...

  6. python_06

    今日内容:注意: selenium驱动的浏览器是干净的,没有任何缓存. 1.selenium剩余用法 2.selenium万能登录破解 3.selenium爬取京东商品信息 4.破解极验滑动验证码 X ...

  7. OO_Unit4_Summary暨课程总结

    初始oo,有被往届传言给吓到:oo进行中,也的确有时会被作业困扰(debug到差点放弃):而oo即将结束的此刻,却又格外感慨这段oo历程. 一.单元架构设计 本单元任务是设计一个UML解析器,能够支持 ...

  8. 妙味课堂史上最全的javascript视频教程,前端开发人员必备知识点,新手易学,拔高必备!!!

    妙味课堂是北京妙味趣学信息技术有限公司旗下的IT前端培训品牌, 妙味课堂是一支独具特色的IT培训团队,妙味反对传统IT教育枯燥乏味的教学模式,妙味提供一种全新的快乐学习方法! 妙味js视教第一部分  ...

  9. 小D课堂 - 零基础入门SpringBoot2.X到实战_第1节零基础快速入门SpringBoot2.0_1、SpringBoot2.x课程介绍和高手系列知识点

    1 ======================1.零基础快速入门SpringBoot2.0 5节课 =========================== 1.SpringBoot2.x课程全套介绍 ...

随机推荐

  1. 在OpenFOAM中做用户自定义库——编译library【转载】

    转载自:http://openfoam.blog.sohu.com/22041538.html OpenFOAM自己提供的标准类都是以库的形式提供的,并且利用头文件给出了库的应用接口.这样一来,用户的 ...

  2. iOS UILabel镂空特效

    http://stackoverflow.com/questions/18716751/drawing-a-path-with-subtracted-text-using-core-graphics ...

  3. 《Glibc内存管理》笔记DAY3

    目录 边界标记法 内容来源 边界标记法 /* conversion from malloc headers to user pointers, and back */ #define chunk2me ...

  4. Alpha项目冲刺! Day4-产出

    各个成员今日完成的任务 林恩:任务分工,博客撰写,了解安卓环境搭建 杨长元:安卓本地数据库基本建立 李震:学习 胡彤:完善服务端 寇永明:学习 王浩:学习 李杰:学习 各个成员遇到的问题 林恩:为自己 ...

  5. 关于Flutter启动项目白屏,报错[ERROR:flutter/shell/gpu/gpu_surface_gl.cc(58)] Failed to setup Skia Gr context.问题的解决方案

    首先,环境如下: 1.系统:windows10 64位   Android SDK version: 28.0.3   Flutter SDK: v1.5.4-hotfix.2   模拟器: 网易Mu ...

  6. ? 原创: 铲子哥 搜狗测试 今天 shell编程的时候,往往不会把所有功能都写在一个脚本中,这样不太好维护,需要多个脚本文件协同工作。那么问题来了,在一个脚本中怎么调用其他的脚本呢?有三种方式,分别是fork、source和exec。 1. fork 即通过sh 脚本名进行执行脚本的方式。下面通过一个简单的例子来讲解下它的特性。 创建father.sh,内容如下: #!/bin/bas

    ? 原创: 铲子哥 搜狗测试 今天 shell编程的时候,往往不会把所有功能都写在一个脚本中,这样不太好维护,需要多个脚本文件协同工作.那么问题来了,在一个脚本中怎么调用其他的脚本呢?有三种方式,分别 ...

  7. 【转】nodejs获取post请求发送的formData数据

    前端post请求发送formData的类型数据时,需要服务端引入中间件body-parser,主要原因是post请求发送的数据,是在http的body里面,所以需要进行解析,否则获取不到数据(数据为空 ...

  8. vue项目中 favicon.ico不能正确显示的问题

    方法一:修改index.html文件 <link rel="shortcut icon" type="image/x-icon" href="f ...

  9. tensorflow cpu问题

    返回: -- ::] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 ...

  10. osg osgViewer::View::setUpViewInWindow()

    void ViewerBase::frame(double simulationTime) { if (_done) return; // OSG_NOTICE<<std::endl< ...