1.项目名不以数字开动,会自己加下划线。
2.代码段
工具===》代码段管理器
eg:
cw的代码段:
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>cw</Title>
<Shortcut>cw</Shortcut>
<Description>Console.WriteLine 的代码段</Description>
<Author>Microsoft Corporation</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal Editable="false">
<ID>SystemConsole</ID>
<Function>SimpleTypeName(global::System.Console)</Function>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[$SystemConsole$.WriteLine($end$);]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>

bool scoreConvert=int.TryParseC(onsole.ReadLine,out score)
if(!scoreConvert)
{
......
continue;
}
3.功能分离方便维护
4.用
#region
#endregion
来折叠代码
5.Console.Write(......+"\t");
6.伪随机数:Random产生随机数的方法是:通过种子来运算出随机数,如果不指定种子的话,默认以时间为种子。尽量不要把它new到循环里,因为每次循环间隔时间很短,会使得种子一样,得到的随机数也会一样。
7.Math中有各种数学运算
8.静态方法中用其他方法,也得是静态方法
9.多次使用的代码(超过一次)最好就将他封装起来。
10.骆驼命名:firstScendThird用于类大括号中的字段、变量
帕斯卡命名:FirstScendThird用于定义方法、类
11.大小写转换:aa=aa.Substring(0,1).ToLower()+aa.Substring(1)
其中要用aa=来接收结果,字符串的不可改变性。
变大写:aa.ToUpper()
12.必须:(三个变量)交换
2个交换:
13.ref、out把值类型的参数变成引用类型。
ref要参与=右边的运算
out只出现在=左边,不参运算
14.找最大值的时候,定义中间变量max的时候要int temp=array[...],从数组中取数,而不能随便定义0,因为不能确定数组中的值是否大于0.
15.数组中有个max方法可以得到最大值
16.ToString(“0.00”)按指定格式输出。小数,时间。yy-MM-dd ==>85-03-03
yy-M-d==>85-3-3
17.强制类型转换:往大了转
18.冒泡的思想:
2.代码段
工具===》代码段管理器
eg:
cw的代码段:
<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>cw</Title>
<Shortcut>cw</Shortcut>
<Description>Console.WriteLine 的代码段</Description>
<Author>Microsoft Corporation</Author>
<SnippetTypes>
<SnippetType>Expansion</SnippetType>
</SnippetTypes>
</Header>
<Snippet>
<Declarations>
<Literal Editable="false">
<ID>SystemConsole</ID>
<Function>SimpleTypeName(global::System.Console)</Function>
</Literal>
</Declarations>
<Code Language="csharp"><![CDATA[$SystemConsole$.WriteLine($end$);]]>
</Code>
</Snippet>
</CodeSnippet>
</CodeSnippets>
bool scoreConvert=int.TryParseC(onsole.ReadLine,out score)
if(!scoreConvert)
{
......
continue;
}
3.功能分离方便维护
4.用
#region
#endregion
来折叠代码
5.Console.Write(......+"\t");
6.伪随机数:Random产生随机数的方法是:通过种子来运算出随机数,如果不指定种子的话,默认以时间为种子。尽量不要把它new到循环里,因为每次循环间隔时间很短,会使得种子一样,得到的随机数也会一样。
7.Math中有各种数学运算
8.静态方法中用其他方法,也得是静态方法
9.多次使用的代码(超过一次)最好就将他封装起来。
10.骆驼命名:firstScendThird用于类大括号中的字段、变量
帕斯卡命名:FirstScendThird用于定义方法、类
11.大小写转换:aa=aa.Substring(0,1).ToLower()+aa.Substring(1)
其中要用aa=来接收结果,字符串的不可改变性。
变大写:aa.ToUpper()
12.必须:(三个变量)交换
2个交换:
13.ref、out把值类型的参数变成引用类型。
ref要参与=右边的运算
out只出现在=左边,不参运算
14.找最大值的时候,定义中间变量max的时候要int temp=array[...],从数组中取数,而不能随便定义0,因为不能确定数组中的值是否大于0.
15.数组中有个max方法可以得到最大值
16.ToString(“0.00”)按指定格式输出。小数,时间。yy-MM-dd ==>85-03-03
yy-M-d==>85-3-3
17.强制类型转换:往大了转
18.冒泡的思想: