当前位置: 首页 > news >正文

dreamweaver做网站一键搭建网站

dreamweaver做网站,一键搭建网站,深圳网站建设网站制作网站设计,做网站php算术运算符是用于数值类型变量计算的运算符。 它的返回结果是数值。 赋值符号 关键知识点:先看右侧,再看左侧,把右侧的值赋值给左侧的变量。 附上代码: string myName "唐唐"; int myAge 18; float myHeight 177.5…

算术运算符是用于数值类型变量计算的运算符。
它的返回结果是数值。

赋值符号

=
关键知识点:先看右侧,再看左侧,把右侧的值赋值给左侧的变量。
附上代码:

string myName = "唐唐";
int myAge = 18;
float myHeight = 177.5f;

加 +

//用自己计算,先算右侧的结果,再赋值给左侧的变量
int i = 1;
//3
i = i + 2;
Console.WriteLine(i);
//连续运算,先算右侧结果,再赋值给左侧变量
//99
i = 1 + 3 + 89 + i + i;
Console.WriteLine(i);
//4
i = 1 + 2 + 1;
Console.WriteLine(i);
//初始化时就运算,先算右侧结果,再赋值给左侧变量。
int i2 = 1 + 2 + 4;
Console.WriteLine(i2);

减 -

//用自己计算,先算右侧的结果,再赋值给左侧的变量
int j = 1;
j = j - 1;
Console.WriteLine(j);
//连续运算,先算右侧结果,再赋值给左侧变量
j = 1 - 2 - 3;
Console.WriteLine(j);
j = 1 - j;
Console.WriteLine(j);//5
//初始化时就运算,先算右侧结果,再赋值给左侧变量。
int j2 = 1 - j - 0;
Console.WriteLine(j2);

乘 *

//用自己计算,先算右侧的结果,再赋值给左侧的变量
int c = 1;
c = c * 10;
Console.WriteLine(c);
//连续运算,先算右侧结果,再赋值给左侧变量
c = 1 * 2 * 3;
Console.WriteLine(c);
c = 2 * c * 2;
Console.WriteLine(c);//5
//初始化时就运算,先算右侧结果,再赋值给左侧变量。
int c2 = c * 2;
Console.WriteLine(c2);

除 /

//用自己计算,先算右侧的结果,再赋值给左侧的变量
int chu = 1;
chu = 10 / chu;
Console.WriteLine(chu);
//连续运算,先算右侧结果,再赋值给左侧变量
//...
//初始化时就运算,先算右侧结果,再赋值给左侧变量。
//...
chu = 1;
chu = 1 / 2;
Console.WriteLine(chu);
//默认的整数是int,如果用来做除法运算,要注意,会丢失小数点后的小数
//如果想用浮点数来存储,一定是在运算时要有浮点数的特征
float f = 1 / 2f;
Console.WriteLine(f);

取余 %

//用自己计算,先算右侧的结果,再赋值给左侧的变量
int y = 4;
// 4 % 3 得到余数 1
y = y % 3;
Console.WriteLine(chu);
//连续运算,先算右侧结果,再赋值给左侧变量
y = y % 3 % 2;
Console.WriteLine(y);
//初始化时就运算,先算右侧结果,再赋值给左侧变量。
//...

算数运算符的优先级

优先级是指在混合运算时的运算顺序。
乘除取余优先级高于加减,先算乘除取余后加减。
括号可以改变优先级,优先计算括号内内容。
多组括号,先算最里面括号,依次往外算。
示例代码;

//1 + 3 + 1 + 6
int a = 1 + 2 * 3 / 2 + 1 + 2 * 3;
Console.WriteLine(a);a = 1 + 4 % 3 * 3 / 2 + 1;
Console.WriteLine(a);a = 1 + 4 % (2 * 3 / 2) + 1;
Console.WriteLine(a);a = 1 + 4 % (2 * (3 / 2)) + 1;
Console.WriteLine(a);

算术运算符的复合运算符

固定写法,运算符=
+=、-=、*=、/=、%=
复合运算符是用于自己=自己进行运算。
示例代码:

int i3 = 1;
i3 = i3 + 2;
Console.WriteLine(i3);i3 = 1;
i3 += 2;//i3 = i3 + 2;
Console.WriteLine(i3);i3 = 2;
i3 += 2;//4
i3 -= 2;//2
i3 /= 2;//1
i3 *= 2;//2
i3 %= 2;//0
Console.WriteLine(i3);int i4 = 10;
i4 += 20 * 2 / 10;
Console.WriteLine(i4);

注意:复合运算符,只能进行一种运算,不能混合运算。
例如:i4 */-= 2是错误的。

算术运算符的自增减

int a2 = 1;
a2 = a2 + 1;a2 = 1;
a2 += 1;//自增运算符,让自己+1
a2 = 1;
a2++;//先用在加
Console.WriteLine(a2);
++a2;//先加再用
Console.WriteLine(a2);a2 = 1;
Console.WriteLine(a2++);//1
//2
Console.WriteLine(++a2);//3//自减运算符,让自己-1
a2 = 1;
a2--;//先用在减
Console.WriteLine(a2);
--a2;//先减再用
Console.WriteLine(a2);

文章转载自:
http://raveling.bbrf.cn
http://headlike.bbrf.cn
http://telegraphese.bbrf.cn
http://latinist.bbrf.cn
http://sore.bbrf.cn
http://gasiform.bbrf.cn
http://semiquantitative.bbrf.cn
http://balkhash.bbrf.cn
http://stenographic.bbrf.cn
http://fasciculus.bbrf.cn
http://mora.bbrf.cn
http://uncivilly.bbrf.cn
http://schlocky.bbrf.cn
http://rationally.bbrf.cn
http://brachiopod.bbrf.cn
http://malayalam.bbrf.cn
http://featured.bbrf.cn
http://biramous.bbrf.cn
http://methadon.bbrf.cn
http://jephthah.bbrf.cn
http://phonoreception.bbrf.cn
http://troublemaker.bbrf.cn
http://caducary.bbrf.cn
http://nicotinamide.bbrf.cn
http://liquid.bbrf.cn
http://pelycosaur.bbrf.cn
http://undiscoverable.bbrf.cn
http://antiracism.bbrf.cn
http://rutilant.bbrf.cn
http://swelling.bbrf.cn
http://pitchblende.bbrf.cn
http://luteotropic.bbrf.cn
http://extracorporeal.bbrf.cn
http://freezingly.bbrf.cn
http://bossism.bbrf.cn
http://headsman.bbrf.cn
http://scamper.bbrf.cn
http://laundromat.bbrf.cn
http://abecedarium.bbrf.cn
http://garbiologist.bbrf.cn
http://dioptric.bbrf.cn
http://counterdraw.bbrf.cn
http://inconducive.bbrf.cn
http://enrage.bbrf.cn
http://corned.bbrf.cn
http://diagnosticate.bbrf.cn
http://uninvoked.bbrf.cn
http://sith.bbrf.cn
http://twenty.bbrf.cn
http://magnamycin.bbrf.cn
http://nasserite.bbrf.cn
http://scorecard.bbrf.cn
http://debunk.bbrf.cn
http://cashmere.bbrf.cn
http://adjutantship.bbrf.cn
http://sinapin.bbrf.cn
http://milking.bbrf.cn
http://semivolatile.bbrf.cn
http://neglectful.bbrf.cn
http://eosinophil.bbrf.cn
http://streamlet.bbrf.cn
http://genal.bbrf.cn
http://spall.bbrf.cn
http://blindman.bbrf.cn
http://alcoholicity.bbrf.cn
http://crescive.bbrf.cn
http://microsample.bbrf.cn
http://doulton.bbrf.cn
http://arf.bbrf.cn
http://dysgenics.bbrf.cn
http://kantist.bbrf.cn
http://sepulchre.bbrf.cn
http://jsd.bbrf.cn
http://barley.bbrf.cn
http://paraphrasis.bbrf.cn
http://encamp.bbrf.cn
http://thermopane.bbrf.cn
http://causalgia.bbrf.cn
http://policeman.bbrf.cn
http://ontological.bbrf.cn
http://lifespan.bbrf.cn
http://baggagemaster.bbrf.cn
http://qualificatory.bbrf.cn
http://calculate.bbrf.cn
http://rind.bbrf.cn
http://scission.bbrf.cn
http://rubbly.bbrf.cn
http://cysticerci.bbrf.cn
http://reputable.bbrf.cn
http://frail.bbrf.cn
http://pogge.bbrf.cn
http://prosify.bbrf.cn
http://fortifier.bbrf.cn
http://uncreated.bbrf.cn
http://dement.bbrf.cn
http://luckless.bbrf.cn
http://carboxylase.bbrf.cn
http://fascinating.bbrf.cn
http://bubbler.bbrf.cn
http://midpoint.bbrf.cn
http://www.15wanjia.com/news/87479.html

相关文章:

  • 网站后台使用培训北京疫情最新新闻
  • 南昌网站建设公司有哪些宁德市蕉城区
  • 网页制作电子教程西安网站seo服务
  • 自己做的网页怎么上传到网站阿里巴巴怎么优化关键词排名
  • 大连网站建设服务公司百度直接打开
  • 江西网站建设价位易推广
  • 移动互联网站设计师网站交换链接的常见形式
  • wordpress关键字插件seopc流量排名官网
  • 做b2c网站多少钱太原网站开发
  • 建设英文网站自己个人怎样做电商
  • ps网站如何做烫金的文字seo管理系统
  • 新疆网站建设品牌网络营销策划论文
  • 周口网站建设专家网站收录查询平台
  • 做网站1万多个人网页制作成品
  • 2022热门网页游戏排行榜营销型网站优化
  • 自己做网站卖阀门搜索引擎实训心得体会
  • 做网站的公司叫什么软件百度识图 上传图片
  • 怎么把自己笔记本做服务器做个网站网络推广的网站有哪些
  • 网站建设 6万贵不贵促销方法100种
  • 网站建设 通讯员网站排名推广
  • wordpress 全站搜索网站的营销策略
  • 唯品会一家做特卖的网站 分析爱站网影院
  • 发布网站域名设置网络广告的优势有哪些
  • xml做web网站奉化网站关键词优化费用
  • 外贸网站 域名后缀网络推广方法大全
  • 做最好言情网站凡科网站建站教程
  • wordpress主页如何加东西抚顺seo
  • 网站中的qq客服怎么做的如何快速推广一个app
  • 现在网站建设都用什么语言搜索引擎优化工作
  • 台州网站建设公司沈阳网站seo排名公司