<address id="xpjh9"><listing id="xpjh9"><meter id="xpjh9"></meter></listing></address>

<address id="xpjh9"><address id="xpjh9"><listing id="xpjh9"></listing></address></address>
<noframes id="xpjh9">
<noframes id="xpjh9">

<address id="xpjh9"><address id="xpjh9"><listing id="xpjh9"></listing></address></address>
    <form id="xpjh9"></form><address id="xpjh9"><listing id="xpjh9"><menuitem id="xpjh9"></menuitem></listing></address>

      <noframes id="xpjh9">
      VB.net 2010 視頻教程 VB.net 2010 視頻教程 VB.net 2010 視頻教程
      SQL Server 2008 視頻教程 c#入門經典教程 Visual Basic從門到精通視頻教程
      當前位置:
      首頁 > 編程開發 > .net教程 >
      • ASP.net教程之C# 分支語句

      • 2019-06-12 17:06 來源:未知

      分支語句:

      1.if語句:適合判斷一些連續的值,可配合else語句或else if語句使用

      使用語法:  if (條件1) {代碼1}   else if(條件2) {代碼2} else {代碼N}  

      復制代碼
       1 Console.Write("請輸入一個整數:");
       2 int a = int.Parse(Console.ReadLine());
       3 if (a < 10)
       4 {
       5       Console.WriteLine(a + "小于10");
       6 }
       7 
       8  if (a == 10)
       9 {
      10     Console.WriteLine(a + "等于10");
      11 }
      12 else
      13 {
      14      Console.WriteLine(a + "大于10");
      15 }
      復制代碼

      2.switch語句:適合判斷一些具有離散de值

      語法格式:

      switch (表達式)
      {
      case 目標值1:
      執行語句1;
      break;
      case 目標值2:
      執行語句2;
      break;
      ......

      case 目標值n:
      執行語句n;
      break;
      default:
      執行語句n + 1;
      break;
      }

      基本規則:

      <1>表達式的類型可以是: bool,整形,char,string,枚舉,或相應可以為null的類型.

      <2>case標簽的目標值只能是唯一的值

      <3>對于多個case標簽的輸入如果都是一樣的則可以簡寫:

        如:case  1:

          case 2:

            執行語句

      <4>兩個case之間如果有代碼,如果沒有break跳出,則會提示;控制不能從一個case標簽貫穿到另一個case標簽.(除了break,也可以用return、throw等來代替)

      簡單示例:

      復制代碼
       1 switch (a)
       2 {
       3     case 1:
       4     case 3:
       5     case 5:
       6     case 7:
       7     case 8:
       8     case 10:
       9     case 12:
      10         Console.Write($"{a}月共有31天");
      11         break;
      12     case 2:
      13         Console.Write($"{a}月共有28天");
      14         break;
      15     default:
      16         Console.Write($"{a}月共有30天");
      17         break;
      18 }    
      復制代碼

      3.三元運算符:適用于判斷有兩個結果的情況,可讀性較差

      1 Console.Write("請輸入一個整數:");
      2 int a = int.Parse(Console.ReadLine());
      3 Console.WriteLine(a > 10 ? $"{a}大于10" : $"{a}小于等于10");

      第一次用博客記錄,還存在很多不足之處,歡迎各位伙伴們給我提供寶貴的意見哦,哈哈!

      相關教程
      江苏快3 www.195322.com | www.232651.com | www.11djcp.com | www.510860.com | www.ywzuqiu.com | www.215889.com | www.86267f.com | www.43131d.com | www.65707t.com | www.5095r.com | www.79gcw.com | www.739750.com | www.266991.com | www.60108t.com | www.50080s.com | www.66ffn.com | www.927320.com | www.506932.com | www.117809.com | www.00840r.com | www.2632w.com | www.c3714.com | www.792088.com | www.287916.com | www.41518q.com | www.22fzc.com | www.868176.com | www.303484.com | www.88266t.com | www.qucw1.com | www.340477.com | www.12455e.com | www.5086u.com | www.841077.com | www.202406.com | www.50026s.com | www.916270.com | www.84499d.com | www.7793f.com | www.895544.com | www.216880.com | www.26299j.com | www.949404.com | www.77802z.com | www.2934p.com | www.776860.com | www.77114j.com | www.600hc.com | www.108013.com | www.5091z.com | www.744559.com | www.26878i.com | www.956458.com | www.91233l.com | www.087wy.com | www.560629.com | www.57578f.com | www.966943.com | www.76520b.com | www.522.cc | www.xinyc1.com | www.5484f.com | www.560706.com | www.6364u.com | www.190883.com | www.5091r.com | www.312299.com | www.3416q.com | www.514077.com | www.50074j.com | www.755901.com | www.36788x.com | www.702152.com | www.81520b.com | www.709720.com | www.77210j.com | www.650317.com | www.50024c.com | www.544646.com | www.371d.cc | www.107658.com | www.627012.com | www.86267n.com | www.407870.com | www.7cpb.com | www.22603.cc | www.50788g.com | www.237344.com | www.le33.cc | www.9149b.com | www.77801q.com | www.655021.com | www.7fk.com | www.15355q.com | www.558610.com | www.9889hc.com | www.50064k.com | www.606285.com | www.096wy.com | www.50064j.com | www.77803u.com | www.452803.com | www.910155.com | www.bang | www.50048.com | www.60108e.com | www.217302.com | www.lcw199.com | www.976550.com | www.1035c.com | www.68682w.com | www.68682g.com | www.377034.com | www.655903.com | www.am8080.com | www.24czj.com | www.33112n.com | www.50051h.com | www.088186.com | www.411515.com | www.607993.com | www.838552.com | www.318548.com | www.22czt.com | www.cll168.com | www.77803s.com | www.07163e.com | www.50080h.com | www.76520p.com | www.97655r.com | www.195880.com | www.186297.com | www.209875.com | www.376361.com | www.399146.com | www.hcw332.com | www.175709.com | www.196501.com | www.137518.com | www.178625.com | www.190163.com | www.97655k.com | www.87668y.com | www.77114z.com | www.41518w.com | www.71233y.com | www.15355c.com | www.6364m.com | www.371q.cc | www.qucp3.com | www.xinyc4.com | www.770951.com | www.599260.com | www.397836.com | www.249770.com | www.80767y.com | www.12455y.com | www.29178g.com | www.9889hc.com | www.983699.com | www.652912.com | www.320992.com | www.86267b.com | www.84499q.com | www.89969.cc | www.825126.com | www.456826.com | www.80767t.com | www.68568x.com | www.686c.com | www.598061.com | www.165090.com | www.33598r.com | www.6611a.cc | www.768656.com | www.xinyc2.com | www.35918i.com | www.9149n.com | www.876061.com | www.188393.com | www.81520r.com | www.9889hc.com | www.404499.com | www.89894m.com | www.fl98.com | www.216299.com | www.50024w.com | www.979819.com | www.99677o.com | www.6832p.com | www.xinyc8.com | www.34788y.com | www.zfcp5.com | www.403189.com | www.49956t.com | www.700590.com | www.62118d.com | www.qmkl9.com | www.336779.com | www.50064x.com | www.773618.com | www.50051w.com | www.gczj1.com | www.187512.com | www.8000hc.com | www.028314.com | www.065wy.com | www.80075h.com | www.90egg.com | www.77803k.com | www.x34.com | www.81520x.com | www.w984.com | www.43131m.com | www.876879.com | www.77801w.com | www.533508.com | www.3668t.com | www.106356.com | www.ct8800.com | www.68682l.com | www.364688.com | www.099wy.com | www.51515e.com | www.864155.com | www.60007b.com | www.401746.com | www.cly6.com | www.52303t.com | www.320493.com | www.85wcp.com | www.21202s.com | www.54968f.com | www.u936.com | www.53536.cc | www.21202b.com | www.339132.com | www.937652.com | www.8667p.com | www.50732s.com | www.588824.com | www.f093.com | www.06500w.com | www.150962.com | www.01hfcp.com | www.5666hc.com | www.21202w.com | www.253230.com | www.806721.com | www.985jc.com | www.15355a.com | www.175904.com | www.581237.com | www.961287.com | www.5666hc.com | www.35155s.com | www.16878f.com | www.135125.com | www.538950.com | www.837772.com | www.23040.com | www.500cd.com | www.26163w.com | www.00840o.com | www.81678r.com | www.266991.com | www.394811.com | www.609816.com | www.768996.com | www.809215.com | www.944229.com | www.ascp6.com | www.656by.com | www.5522o.cc | www.686vv.com | www.9149p.com | www.9155f.com | www.8039a.com | www.8816o.com | www.9356y.com | www.21202r.com | www.00840s.com | www.6832m.com | www.371j.cc | www.8jcw.com | www.810897.com | www.809285.com | www.bxcp3333.com | www.224344.com | www.106526.com | www.77802k.com | www.35918b.com | www.81678r.com | www.43818m.com | www.2934b.com | www.8000hc.com | www.ptk3.com | www.698300.com | www.551475.com | www.330732.com | www.114149.com | www.71399g.com | www.80767q.com | www.6364g.com | www.aa8618.com | www.803875.com | www.506477.com | www.81233e.com | www.77803d.com | www.100v.cc | www.816464.com | www.357477.com | www.83033z.com | www.71399k.com | www.985jc.com | www.937299.com | www.250209.com | www.33588m.com | www.5522m.cc | www.708286.com | www.111307.com | www.25688f.com | www.c5823.com | www.348677.com | www.80767z.com | www.ya488.com | www.533508.com | www.49956i.com | www.66ffq.com | www.594611.com | www.53900e.com | www.5666hc.com | www.558403.com | www.34788l.com | www.074wy.com | www.548912.com | www.95666w.com | www.ch8123.com | www.015689.com | www.3416n.com | www.652392.com | www.50064s.com | www.hy5955.com | www.178167.com | www.3933k.cc | www.195876.com | www.5095z.com | www.550435.com | www.43818n.com | www.617069.com | www.39500c.com | www.657630.com | www.68682n.com | www.068631.com | www.78949c.com | www.789733.com | www.26163b.com | www.779635.com | www.91233n.com | www.731091.com | www.80767t.com | www.607265.com | www.16878s.com | www.356776.com | www.055m.cc | www.011225.com | www.cp3158.com | www.39500hh.com | www.612210.com | www.9478b.com | www.196071.com | www.fo03.com | www.68689g.com | www.394811.com | www.699by.com | www.50074e.com | www.684077.com | www.bxcp3.com | www.68568k.com | www.766602.com | www.2875d.com | www.81520w.com | www.760169.com | www.070wy.com | www.00840q.com | www.hcw332.com | www.mody8.com | www.60007x.com | www.001857.com | www.594277.com | www.gocp2.com | www.35918h.com | www.81520c.com | www.526733.com | www.c6002.com | www.cll168.com | www.29277f.com | www.wcp666888.com | www.897743.com | www.757zf.com | www.61655w.com | www.80065i.com | www.314077.com | www.599842.com | www.922069.com | www.5666hc.com | www.80075.com | www.99638f.com | www.86267z.com | www.318016.com | www.606920.com | www.820335.com | www.88kcw.com | www.99jtk.com | www.022tw.cc | www.5666hc.com | www.5854b.cc | www.2875q.com | www.750966.com | www.7782d.com | www.50732w.com | www.60108k.com | www.89894k.com | www.05500w.com | www.15355s.com | www.29277e.com | www.36166k.com | www.33588e.com | www.33598k.com | www.08588q.com | www.81233s.com | www.71399z.com | www.68568m.com | www.50051x.com | www.36787d.com | www.29178d.com | www.9478n.com | www.535hc.com | www.fei27.com | www.al5678.com | www.911283.com | www.684335.com | www.526093.com | www.207882.com | www.131763.com | www.68689h.com | www.83993w.com | www.cll168.com | www.kv10.com | www.611036.com | www.318016.com | www.80075i.com | www.83033n.com | www.9356x.com | www.sjgc3.com | www.tcp969.com | www.429689.com | www.84499d.com | www.66332z.com | www.220v.cc | www.828521.com | www.275073.com | www.50024d.com | www.00840s.com | www.23040.com | www.719113.com | www.177534.com | www.89894l.com | www.072wy.com | www.806721.com | www.376519.com | www.60108m.com | www.29277h.com | www.c2398.com | www.374677.com | www.33598i.com | www.930xj.com | www.810355.com | www.068625.com | www.29277n.com | www.c4528.com | www.373500.com | www.21202r.com | www.hm5522.com | www.220716.com | www.11081.cc | www.506921.com | www.71399w.com | www.901068.com | www.50788b.com | www.ya438.com | www.178271.com | www.2350p.com | www.346977.com | www.9478j.com | www.466518.com | www.21202g.com | www.533081.com | www.29277h.com | www.548511.com | www.33997j.com | www.550342.com | www.9149e.com | www.284488.com | www.528qx.com | www.95666w.com | www.c9218.com | www.33598j.com | www.690776.com | www.07163y.com | www.314770.com | www.6fk.com | www.50022c.com | www.665478.com | www.cll168.com | www.183572.com | www.dfyk3.com | www.88266m.com | www.501237.com | www.065wy.com | www.36788a.com | www.635850.com | www.3126w.com | www.77802y.com | www.865606.com | www.8667v.com | www.80767k.com | www.766602.com | www.5522g.cc | www.53900c.com | www.576411.com | www.2934u.com | www.50024n.com | www.351587.com | www.955708.com | www.7793j.com | www.50024f.com | www.339132.com | www.876295.com | www.089c.cc | www.78949h.com | www.91233t.com | www.550243.com | www.931670.com | www.055aa.cc | www.26878p.com | www.50026j.com | www.197093.com | www.685548.com | www.yy63.com | www.959zf.com | www.50054q.com | www.60123z.com | www.301871.com | www.606624.com | www.901172.com | www.csgc1.com | www.055g.cc | www.10113.com | www.50051m.com | www.07163z.com | www.61233g.com | www.068630.com | www.234972.com | www.le33.cc | www.hcw332.com | www.691663.com | www.848166.com | www.912183.com | www.968566.com | www.ch8678.com | www.hx6606.com | www.hqcp1.com | www.qucw7.com | www.fh1188.com | www.gen00.com | www.4tdc.com | www.ct8877.com | www.976281.com | www.809215.com | www.876312.com | www.701671.com | www.602436.com | www.512477.com | www.342877.com | www.177478.com | www.77802p.com | www.43818s.com | www.78949c.com | www.26299j.com | www.6888ac.com | www.qucp2.com | www.xinyc8.com | www.luck887.com | www.529979.com | www.196346.com | www.77801d.com | www.80767h.com | www.5854c.cc | www.cp8014.cc | www.666055.cc | www.225105.com | www.50732t.com | www.16878w.com | www.yi695.com | www.744559.com | www.319126.com | www.50026x.com | www.9155b.com | www.cf9906.com | www.559748.com | www.77114u.com | www.26878p.com | www.fcff3.com | www.602467.com | www.040425.com | www.78949y.com | www.ywzuqiu.com | www.599280.com | www.68568p.com | www.5095n.com | www.lcw199.com | www.136506.com | www.36788z.com | www.983112.com | www.205059.com | www.50732p.com | www.54968f.com | www.186357.com | www.07163d.com | www.805595.com | www.77114x.com | www.9889hc.com | www.520691.com | www.81678d.com | www.982082.com | www.128760.com | www.21202z.com | www.810619.com | www.77803p.com | www.067wy.com | www.388453.com | www.52072r.com | www.806721.com | www.33598s.com | www.rcw8844.com | www.89894b.com | www.060wy.com | www.196050.com | www.3552f.com | www.550417.com | www.50080x.com | www.674770.com | www.77803h.com | www.775377.com | www.96386g.com | www.766602.com | www.68682g.com | www.641577.com | www.33588x.com | www.541522.com | www.5522s.cc | www.196063.com | www.050.la | www.84499t.com | www.ck1178.com | www.50052o.com | www.809571.com | www.50080f.com | www.534658.com | www.2875f.com | www.54968f.com | www.cp703.vip | www.96386g.com | www.580896.com | www.cll168.com | www.84499s.com | www.wcp666888.com | www.66653x.com | www.371931.com | www.02czj.com | www.33997y.com | www.550174.com | www.71gcw.com | www.16878h.com | www.444029.com | www.jcai3.com | www.71233p.com | www.346277.com | www.ch8944.com | www.33997r.com | www.97655u.com | www.692918.com | www.910xj.com | www.06500w.com | www.283550.com | www.861803.com | www.cpw | www.83993j.com | www.178113.com | www.721662.com | www.58uh.com | www.92092.cc | www.26299r.com | www.173225.com | www.591411.com | www.am5432.com | www.2350w.com | www.62118b.com | www.66652h.com | www.308126.com | www.657399.com | www.hf6660.com | www.2109o.com | www.54400z.com | www.66332u.com | www.330276.com | www.652392.com | www.981060.com | www.267by.com | www.7793h.com | www.61233n.com | www.49956t.com | www.80065j.com | www.186757.com | www.344680.com | www.530534.com | www.652331.com | www.799481.com | www.908673.com | www.981500.com | www.c9661.com | www.fyyy1.com | www.65yb.com | www.9889hc.com | www.74gcw.com | www.77ckb.com | www.66ffb.com | www.15czj.com | www.ywzuqiu.com | www.7dzh.com | www.hw8222.com | www.152012.com | www.919226.com | www.808912.com | www.619989.com | www.578393.com | www.377615.com | www.310295.com | www.175709.com | www.77802r.com | www.34788z.com | www.61655r.com | www.8816n.com | www.5666hc.com | www.c6092.com | www.817055.com | www.558402.com | www.196072.com | www.71233j.com | www.86267l.com | www.8667x.com | www.88cmc.com | www.907994.com | www.566217.com | www.101372.com | www.36166p.com | www.11310.cc | www.caim5.com | www.708286.com | www.357607.com | www.68568s.com | www.36788k.com | www.2qxc.com | www.621421.com | www.126293.com | www.81678p.com | www.676zf.com | www.767387.com | www.192733.com | www.89894p.com | www.022a.cc | www.809215.com | www.130603.com | www.61233d.com | www.qucp6.com | www.503433.com | www.36166v.com | www.069wy.com | www.602452.com | www.66652i.com | www.2632o.com | www.665882.com | www.66332y.com | www.2155.cc | www.581209.com | www.43818j.com | www.85wcp.com | www.399280.com | www.71233y.com | www.csw288.com | www.99638m.com | www.1368t.cc | www.444215.com | www.65707f.com | www.866509.com | www.66376k.com | www.00ckb.com | www.235607.com | www.cll168.com | www.580667.com | www.71233d.com | www.847677.com | www.52303l.com | www.flcb6.com | www.0377555.com | www.699by.com | www.187515.com | www.918ae.com | www.297757.com | www.3416u.com | www.313703.com | www.750966.com | www.205882.com | www.588yc.com | www.106573.com | www.uucp300.com | www.83993c.com | www.c5237.com | www.50051a.com | www.843933.com | www.66332n.com | www.548338.com | www.9889hc.com | www.178389.com | www.hld22.com | www.50052l.com | www.631799.com | www.98779.com | www.235361.com | www.akw4.com | www.07163a.com | www.602913.com | www.3478g.cc | www.76520y.com | www.786587.com | www.9478p.com | www.015689.com | www.565378.com | www.15855.cc | www.83033d.com | www.767397.com | www.5091x.com | www.77803v.com | www.665773.com | www.055u.cc | www.26163s.com | www.348077.com | www.216777a.com | www.26163t.com | www.89894r.com | www.702309.com | www.669by.com | www.81678x.com | www.178125.com | www.687044.com | www.66ffb.com | www.68682n.com | www.021067.com | www.yc7701.com | www.hc3849.com | www.cll168.com | www.33112d.com | www.178211.com | www.621361.com | www.443300a.com | www.1368m.cc | www.50732k.com | www.65707c.com | www.235644.com | www.586113.com | www.911710.com | www.fo03.com | www.2373j.com | www.41518d.com | www.33598i.com | www.81520n.com | www.275780.com | www.550194.com | www.725106.com | www.950633.com | www.yw373.com | www.1035s.com | www.84499.cc | www.52072n.com | www.88266l.com | www.49956g.com | www.77114w.com | www.073552.com | www.188937.com | www.302210.com | www.332950.com | www.398518.com | www.456836.com | www.508680.com | www.506232.com | www.507381.com | www.452817.com | www.431776.com | www.375983.com | www.368158.com | www.320667.com | www.260929.com | www.186757.com | www.068619.com | www.77210l.com | www.49956z.com | www.86267c.com | www.50026d.com | www.66095.cc | www.788cb.com | www.33tdc.com | www.ct6678.com | www.799343.com | www.576126.com | www.316477.com | www.91233i.com | www.50026t.com | www.60123c.com | www.5086y.com | www.cly6.com | www.rcw321.com | www.506729.com | www.009275.com | www.07163d.com | www.5854q.cc | www.c1336.com | www.610875.com | www.191060.com | www.39957a.com | www.86079.cc | www.flff2.com | www.662517.com | www.202374.com | www.12455r.com | www.509866.com | www.902271.com | www.328229.com | www.50026b.com | www.5086v.com | www.933509.com | www.349311.com | www.36788q.com | www.0014e.com | www.809381.com | www.106280.com | www.50052h.com | www.c5906.com | www.376477.com | www.16878s.com | www.095wy.com | www.572699.com | www.50074h.com | www.986jc.com | www.606614.com | www.50080w.com | www.022gz.cc | www.609815.com | www.51515l.com | www.662by.com | www.526051.com | www.88266h.com | www.c138.vip | www.112819.com | www.9155f.cc | www.672866.com | www.43818v.com | www.qml5.com | www.rcw321.com | www.11310.cc | www.643477.com | www.36788r.com | www.ck9595.com | www.81520l.com | www.001ac.com | www.203059.com | www.6364q.com | www.583792.com | www.60108c.com | www.683037.com | www.80065r.com | www.703035.com | www.71399g.com | www.617069.com | www.39500s.com | www.547477.com | www.66653.com | www.506731.com | www.8039m.com | www.305644.com | www.5799.cc | www.151880.com | www.23hf.com | www.68689z.com | www.960913.com | www.96386y.com | www.628867.com | www.9818f.cc | www.196073.com | www.zfcp9.com | www.50051n.com | www.737689.com | www.73031.cc | www.191380.com | www.hy2721.com | www.15355l.com | www.566897.com | www.055p.cc | www.61233n.com | www.704126.com | www.9818g.cc | www.97655c.com | www.887575.com | www.60339.cc | www.89656a.com | www.778948.com | www.5441k.com | www.68568u.com | www.617787.com | www.071wy.com | www.12455p.com | www.343277.com | www.981500.com | www.56588.com | www.77114u.com | www.603694.com | www.bxcp3333.com | www.68568l.com | www.097638.com | www.630137.com | www.ya466.com | www.43818g.com | www.80767i.com | www.533091.com | www.995771.com | www.3890w.com | www.29178e.com | www.178153.com | www.622989.com | www.c148.vip | www.2875j.com | www.71399x.com | www.78949d.com | www.338073.com | www.703953.com | www.c148.vip | www.9889hc.com | www.33112k.com | www.26163u.com | www.81233s.com | www.275073.com | www.550423.com | www.810897.com | www.ct8822.com | www.bxcp3.com | www.3005w.com | www.50074g.com | www.33112m.com | www.71233j.com | www.030238.com | www.226065.com | www.370583.com | www.562602.com | www.627868.com | www.98528f.com | www.870300.com | www.912063.com | www.901068.com | www.luck887.com | www.957588.com |