a++,先赋值再自增
++a,先自增再赋值
a++,先赋值再自增
++a,先自增再赋值
enum RoleType//枚举类型的名字
{
Mage,Archer,Assassin,Tank,Support,Warrior
//枚举类型的值
}
RoleType roleType=RoleType.Tank;
if(roleType==RoleType.Archer)
{
}
const int j=200//将变量j转变成了常量
递归
f(n)=1*1+2*2+...+n*n
f(n)=f(n-1)+n*n
f(1)=1
10!
f(n)=n*f(n-1)
10!=10*9!
f(1)=1//递归终止条件
CTRL+k Ctrl+c[单行注释化]【】快捷键!CTRL+k Ctrl+u[取消单行注释化]【】快捷键!
static int add3(int a,int b)
//函数修饰符 返回值 函数名/方法名 参数
取得反序
426 (6*10+2)*10+4
624
int temp=i;
int number=0;
while(temp%10!=0)
{
number=number*10+temp%10;
temp=temp\10;
}
每⼀位,只能存储0和1,所以计算机中所有的数据都是使⽤⼆进制来计算的。
内存地址一般使用16进制储存
二进制:0-1
十进制:0-9
八进制:0-7
十六进制:0-9-a b c d e f a-f代表10-15
四位二进制可以转换为一位十六进制
二 十 十六之间如何转换
cd
b
acd
int a = Convert.ToInt32(Console.ReadLine());
int b = Convert.ToInt32(Console.ReadLine());
int c = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("{c}+{b}+{a}");
int eng = Convert.ToInt32(Console.ReadLine());
int mat = Convert.ToInt32(Console.ReadLine());
bool award = eng >= 90 && mat >= 90;
Console.WriteLine(award);
6. 8
4 7 16 16 12
double 点数
double 点数
double
double
int 年龄
int 计数器
double 平均数
double 身高
int 总和
double 温度
writeline writeline writeline writeline writeline输出语句
创建变量
/t和/n的作用
编程语言是工具,软件是产品
相当于
汉语是工具,文学作品是产品
default
exception
11
a+b
3+8
a+b38
a+b11
int[] arr=[50,27,13,40,9,35];
for(int j=0;j<arr.length-1;j++){
for(int i=0;i<arr.length-1-j;i++){
}
}
==不能直接应用于char或者string类型,需要用判断另一头需要用单引号'',而不是双引号