<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 99111aa.com | 55818o.com | www.c2656.com | www.hg0110.com | www.177949.com | www.4887999.com | h8828.net | www.4058dd.com | 4393.com | www.3479g.com | www.hg3598.com | 5001v.com | www.899699.com | 838388v.com | www.hg27388.com | 2211760.com | www.358773.com | www.2850899.com | 2383hh.com | www.26163q.com | www.365109h.com | 4136d.com | www.w3065.com | 27878cc.com | www.9311c.com | www.tyc636.com | 8898555.com | www.4521r.com | 7792a.com | www.671466.com | www.37337.com | kbj7268.com | www.83993g.com | www.0044hg.com | 59964cc.com | www.8313k.com | 6146j.com | www.988068.com | www.6y7y.cc | 18438y.com | www.55228j.com | www.10052233.com | 78666v.com | www.37377d.com | www.df4566.com | 115119.com | www.0012.com | www.70398.com | 1077bb.com | www.68888.am | www.yh8216.com | 53638888.cn | www.6888775.com | www.6491f.com | 01234rr.com | www.zzyl66.com | www.ylg35.com | 22pp8331.com | www.js1045.com | www.668567b.com | 2643m.com | www.66376f.com | www.3tgpd.com | 4036i.com | www.18czj.com | www.55466.com | 2jshhh.com | www.576530.com | www.c5c99.com | 9339999n.com | 8520q.com | www.7240h.com | www.88837p.com | s72227.com | www.897030.com | www.9b003.com | 50000027.com | 1347.com | www.am7979.com | www.801917.com | mgm3242p.com | qzone6.com | www.15355b.com | www.yh111888.com | 99111ff.com | 7888099.com | www.6939j.com | www.6359.com | 746bm.com | 44005156.com | www.15355m.com | www.70389.com | 56988t.vip | tiexin88.com | www.5xcr.com | www.0096aa.com | www.yh6008.com | 93922u.com | www.730631.com | www.369408.com | www.888999yh.com | 9068g.com | 07qipai.cn | www.790711.com | www.ok533.com | 500000518.com | 2061.com | www.938454.com | www.678js333.com | www.698012.com | rrr4255.com | bmw8002.com | www.6769r.com | www.8967s.com | www.38200p.com | dzj112.com | www.160883.com | www.55717q.com | www.03tyc.com | 58588b.com | 6655yh.com | www.43131l.com | www.87668n.com | www.rycp160.com | www.ra8878.com | 6118m.com | www.39957e.com | www.80767r.com | www.983888b.com | www.9544j.com | 13806.com | yin3434.com | www.33112d.com | www.57800p.com | www.4270ll.com | 025352.com | tt6828.com | jjs66.com | www.2934u.com | www.b7764.com | www.122cpb.com | feicai0394.com | 5360f.com | 08119.net | www.c145.vip | www.x4449.com | www.rgcp333.com | www.8181msc.com | feicai0938.com | 7893.cc | m333999.com | www.807683.com | www.89777b.com | www.8967s.com | www.xpj130.com | 97618b.com | 67888c.cc | hhh2848.com | www.271051.com | www.60007p.com | www.b33668.com | www.497789.com | www.68818z.com | 8569811z.com | 38365w.com | 56988g.com | www.68689i.com | www.1666ac.com | www.68365d.com | www.68058888.com | www.2233kk.net | www.333222b.com | 7744ggg.com | lll3405.com | 30170077.com | 38244h.com | www.031566.com | www.912594.com | www.77802s.com | www.742588.com | www.c555.com | www.896suncity.com | www.09569h.com | www.81866q.com | zhcpii.com | 3522uu.com | uc375.com | ss2649.com | 65005.com | www.36787a.com | www.680358.com | www.6769q.com | www.js1046.com | www.752848.com | www.19019d.com | www.33c668.com | www.49bbs.com | www.0267x.com | www.28758i.com | lshtq.cn | 2418009.com | 39830.com | 88x88.com | 4340m.com | 1458c.com | jsh04.net | 888898.cc | xici.net | 2355d.com | bwinooo.com | www.342177.com | www.622230.com | www.837887.com | www.c6465.com | feicai0892.com | www.20550577.com | sha9955.com | hd55net.com | 915590.com | www.21365tt.com | www.ylg07.com | www.0600e.cc | www.hw52.com | 8890832.com | 0022ylc.com | le888c.com | www.929777.com | www.298001.com | www.84499x.com | www.541911.com | 6766aa.com | 7599r.com | 866666q.com | www.78114422.com | www.91779n.com | www.60123s.com | www.332052.com | x9996.com | 28288vv.com | www.77537o.com | www.tyc131.com | www.906009.com | www.560652.com | 566670011.com | a08199.com | www.i30226.com | www.9737xx.me | www.52303f.com | www.153918.com | cc7570c.com | d8503.com | www.842211.com | www.yzqhyz.com | www.952856.com | 35252q.com | yh645.cn | www.358888f.com | www.2208598.com | www.1111y.cc | 3614e.com | 80368mm.com | www.xpj171.com | www.91779c.com | www.5cpb.com | 63305r.com | 76543j.com | www.dd13558.com | www.637907.com | www.647311.com | 88850aa.com | da611.com | www.tstsi.com | www.3301866.com | www.005710.com | s4212.com | www.8694v.com | www.3577.ag | www.901531.com | 8381dd.com | 2649e.com | www.dzcp7777.com | www.555hy.cc | 22117m.com | wxyxqy.com | www.808888p.com | www.009ac.com | 8547hh.com | 5437y.com | www.5446qq.com | www.c9331.com | 60952222.com | www.xw66666.com | www.89677i.com | www.938537.com | i86811.com | www.vns8896.com | www.115527u.com | www.608520.com | 8722aaaa.com | www.700589.com | www.89777s.com | 1468ttt.com | 131lll.net | www.138cpl.com | www.qmkl2.com | 4255e.com | www.hg56777.com | www.8855gvb.com | www.112819.com | 9309208.com | www.000943.com | www.81520x.com | 3405e.com | 78110033.com | www.5719.com | yz5388.com | 88807z.com | www.5981f.com | www.544242.com | c86226.com | www.52564.com | www.33015.cc | 11453322.com | www.698js.com | www.5095c.com | 28758s.com | www.hg1767.com | www.1666b.com | 9002s.com | www.1188hg.com | www.xjs733.com | 3222n.cc | www.8885888.com | www.6678698.com | 66681l.com | www.pu1177.com | www.3775m.com | 1705p.com | www.yh16555.com | www.55111133.com | 6002a.com | www.q27229.com | www.99788r.com | 144258.com | www.71088k.com | www.8667p.com | 9646d.com | www.xpj144.com | www.821260.com | 443636.com | www.o32939.com | www.023128.com | 272h.net | www.11mgm777.com | 162788.com | www.39111ccc.com | www.949429.com | 806807.com | www.cn365m.com | 93936b.com | www.vns990.cc | www.16878a.com | 52688i.com | www.fc687.com | www.560926.com | bwin38.com | www.r999993.com | jixiang10.com | www.2078k.com | www.2373q.com | 88993n.com | www.bwinyz21.com | vip66702.com | www.kelake66.com | www.c6092.com | 08159u.com | www.4102v.com | js001295.com | www.45966.net | www.603694.com | 2643b.com | www.89777t.com | 0289r.com | www.35252v.com | www.068659.com | www.hg7748.com | www.35155q.com | 5003z.com | www.659618.com | 1406766.com | www.91293.com | www.282990.com | www.ylhg0808.com | www.3478f.cc | 61999ww.com | www.55717r.com | 0241x.com | www.6776kk.com | 6hao999.vip | www.23244.com | www.314611.com | www.6491p.com | www.022hk.cc | 3258w.com | www.aobo190.com | ddd1915.com | www.81619.com | 881133xl.com | www.28000o.com | 20174466.com | www.666944.com | 6261hh.com | www.4848p.com | www.339281.com | www.xhtd09.com | www.911203.com | 12742g.com | www.3126l.com | 2247q.com | www.68682m.com | 88851g.com | www.705wb.com | 87965nn.com | www.35898e.com | 5856jj.com | www.7240g.com | d67890.com | www.99094s.com | jjj40033.com | www.415977.com | 8159rrr.cc | www.x98478.com | 3656vv.com | www.3691b.com | 272y.net | www.a773776.com | 444000u.com | www.50080n.com | wp16777.com | www.01883.cc | www.68666p.com | www.cai001.vip | www.546001.com | www.658997.com | www.2288098.com | www.106096.com | www.3170002.com | 89892uu.com | www.162277.com | feicai0954.com | www.472705.com | 2459c.com | www.86339h.com | 22883j.com | www.91233s.com | nn5443.com | www.c4528.com | www.vns1209.com | www.243500.com | www.hg7803.com | 1077ss.com | www.4694m.com | 80892m.com | www.7886276.com | 0166f.com | www.sytg6.com | www.0679555.com | www.84499o.com | www.vipxl.3009300930093009.com | 22296tt.com | www.4136x.com | 5219k.com | www.7714g.com | 6363yy.com | www.606624.com | www.248247.com | xpjbak1.com | www.621301.com | 80892vv.com | www.9155k.com | www.cr1116.com | 9958944.com | www.cai51.com | 4488buyu.com | www.71399j.com | www.pj4666.com | www.109031.com | www.1299js.com | 44449.com | www.08588o.com | www.3435b.com | www.069963.com | www.998855s.com | TY5509.com | www.68689y.com | www.223456f.com | yf2888.com | www.bwinyz42.com | 8449zz.com | www.960207.com | www.l07.com | 88850kk.com | www.120668.com | 3332949.com | lovebet652.com | www.65066ff.com | 7003oo.com | www.c1395.com | www.749888.com | 4288hh.com | www.97655s.com | www.558809.com | 86611m.com | www.w94600.com | 1592l.com | 365063.com | www.4996kf.com | 2247kk.com | www.308680.com | www.8860tt.com | 32126k.net | www.592411.com | www.hjcp2.com | 4541i.com | www.817824.com | www.3122vv.com | 53358l.com | www.998855a.com | www.166tk.com | 36406600.com | www.911373.com | www.91868.com | 90856i.com | www.591411.com | www.27363i.com | 463393.com | www.196079.com | www.bet63c.com | 3136rr.com | 660499.com | www.97828y.vip | www.76060d.com | 2757v.com | www.36166n.com | www.tyc90.com | 2214x.com | www.701250.com | www.808888x.com | 0088buyu.com | js395.com | www.hg08.com | www.00618y.com | p2649.com | www.c9223.com | www.6001.com | 2846n.com | 2844z.com | www.6939n.com | www.88222055.com | 86811pp.com | www.666055.cc | www.26123bb.com | hg33382.com | 3178uu.com | www.26299m.com | www.mgdc46.com | yhxjaomen.vip | 00pp8331.com | www.4444bj.com | www.888zr61.com | 550111j.com | www.081503.com | www.siji05.com | www.55155h.com | 8037mm.com | www.342977.com | www.869934.com | www.88807c.com | 7681003.com | www.355243.com | www.v6996.com | www.i7727.cc | t21148.com | www.43818a.com | www.6889791.com | www.33166.com | 052979.com | jsdas8.com | www.80075c.com | www.3239888.com | D8.com | 55818.com | www.c9337.com | www.89677h.com | www.yh1666.com | 2214xx.com | www.53900o.com | www.pj56c.com | www.129786.com | 56988q.com | 1389hh.com | www.599280.com | www.792087.com | www.hg7869.com | 26668u.com | 20833g.com | www.715777a.com | www.w3410.com | www.k64602.com | 7720i.net | 897dd.cc | www.827021.com | www.vns2018.xyz | www.43288e.com | n888ww.com | 7720l.com | www.652623.com | www.rrqp777.com | www.520008.net | 50000027.com | aaa444000.com | ra9993.com | www.33588j.com | www.5203666.com | www.900671.com | yt8bet.com | c00351.com | www.8816e.com | www.wap.j3app.com | www.884554.com | 37570i.com | 59889q.com | www.50054e.com | www.26299d.com | www.6455.com | www.kj8888.com | 11161199.com | 3559vvv.com | 6868vv.cc | www.598799.com | www.9646d.com | www.9b006.com | www.31399t.com | 2643v.com | 4880n.com | 90856y.com | www.685756.com | www.tyc44222.com | www.00772a.com | www.33js11.com | 88y66.vip | 13222i.com | 4508ww.com | www.99677e.com | www.0014t.com | www.vinisi08.com | www.5049r.com | www.2078s.com | 7726aaa.com | 4288r.com | 80892kk.com | cdlipu.com | www.youcai77.com | www.yun873.com | www.7893w32.com | www.kj803.com | www.hg3968.com | 37570d.com | c82365.com | 49490524.com | bj1111.com | www.866269.com | www.83993m.com | www.730016.com | www.76773.com | www.25288j.com | 1775w.com | 496.net | 2021c.com | 47479.com | 89892bb.com | www.398846.com | www.02czj.com | www.535520.com | www.60886p.com | www.xycp099.com | www.12102.com | www.b8867.com | www.56733z.com | 2455.com | 365vip800.cc | 01234ff.com | 11005003.com | 939000.com | 3999hd.com | www.210755.com | www.878466.com | www.9478a.com | www.3790011.com | www.js89p.vip | www.b35oo.com | www.668cp99.com | www.44438.com | www.vns4668.cc | www.ra222.com | www.7200399.com | uuu8827.com | gg3888.com | 888333.com | 86611z.com | hgw555.com | dzj.tw | 1098.cc | 5504v.com | 35222pp.com | 预览hg9695.com | fhcp127.com | www.196049.com | www.534638.com | www.731091.com | www.flcb5.com | www.0014n.com | www.50064w.com | www.15365a.com | www.ylylc05.com | www.db486.com | www.wnsr118.com | www.xpj3133.cc | www.7036kk.com | www.63606y.com | www.l063801.com | www.r1432.com | www.6880ll.com | www.cn365u.com | www.hg98j.com | www.4136y.com | www.16181x.com | www.6666yh.com | www.3157r.com | www.dzj0707.com | www.7415yy.com | www.8473b.com | www.08bet8.com | www.b35uu.com | www.35700cc.com | www.7225c.com | www.519862.com | www.33678zz.com | www.23819.com | www.68365w.com | www.904488.com | www.13434c.com | www.ya2019l.com | www.87668p.com | www.26163l.com | www.9928aa.com | www.al9888.com | www.701574.com | www.342577.com | www.53900o.com | 6245p.com | j3410.com | 1348.com | 15856c.com | 3467g.am | 68228z.com | 023625.com | nn4675.com | www.32126r.net | www.msc229.com | www.pj903.com | www.789025.com | www.5049x.com | www.10999u.com | www.820025.com | www.3775c.com | www.720650.com | www.99340.cc | www.915366.com | www.436106.com | 59964tt.com | 3568mm.com | js345c.com | 8888c9.com | 7742q.com | 18775w.com | www.4972aa.com | www.hg8903.com | www.p456x.com | www.653968.com | www.hd8679.com | www.6832n.com | www.742255.com | www.33112e.com | 1665s.com | 77ee940.com | 1253-2.com | 5005m.com | www.188tyc.com | www.js9741.com | www.969709.com | www.win1235.com | www.3416p.com | www.394077.com | 8742ll.com | 56988ll.com | 8977mm.com | www.pj90666.com | www.ra1116.com | www.138cph.com | www.2807777.com | www.61655c.com | www.871203.com | 4052o.com | yy76669.com | mg437733.com | www.js72999.com | www.xpj661199.com | www.hg173i.com | www.8998788.com | www.hx1112.com | 36501w.com | 55155z.com | 7720n.net | www.717xpj.com | www.xn229.com | www.91779j.com | www.61655x.com | www.507433.com | 80892ii.com | 6723888.com | www.86611v.com | www.37562.com | www.5189333.com | www.61655f.com | www.407872.com | biying910vip.com | 3fll8.com | www.76060r.com | www.0886drf.com | www.587189.com | www.tj52.com | 883399r.com | 66287c.com | 1859009.com | www.75hk.com | www.5446n.com | www.hcjt7.com | 3202q.com | 4461a.com | www.hg66768.com | www.vns3938.com | www.y63568.com | www.927150.com | 915610.com | 28288r.com | www.3459e.com | www.rr55826.com | www.86267m.com | www.137165.com | b2624.com | 8742a.com | www.bmw3350.com | www.x22789.com | www.599842.com | x48m.com | feicai0576.com | www.hgw00888.com | www.98xpj98.com | www.745955.com | 45637x.com | jinlong12.com | www.889966.com | www.7240j.com | www.581477.com | 2019mm.cc | 33567m.com | www.678309.com | www.ya2019k.com | www.093388.com | 8381hh.com | www.8494p.com | www.9737kk.com | www.0014a.com | wfcp333222.com | 33ww8332.com | www.22gp.com | www.8998885.com | www.187393.com | vip9923.com | www.yh3377.cc | www.00778t.com | www.cp369.net | 20777711.com | h8159.cc | www.55545d.com | www.011ac.com | JS1388p.com | hkmh11.com | www.v948v.com | www.99343.cc | v47479.com | 2418v.com | www.fh70.com | www.5854g.cc | qhc52.com | 2569003.com | www.158cai.com | www.2934v.com | 4647f.com | 7335q.com | www.4136u.com | www.901572.com | 6220nn.com | www.939393.com | www.xpj11005.com | www.355284.com | 3662p.com | www.88jt555.com | www.vn888123.cc | red0035.com | 7720c.net | www.fc841.com | www.05883.cc | 2613h.com | www.546995.com | www.g83377.com | www.330836.com | 4590c.com | www.600kk.com | www.51515k.com | 226688f.vip | www.81866t.com | www.9570117.com | www.585065.com | 3662p.com | www.hg0019.com | www.49956y.com | 0201ff.com | www.vns62999.com | www.1113yl.com | wh1030.com | 59889t.com | www.hg8mm.com | www.504638.com | 365spa.com | www.681122.com | www.tctx8.com | hg0266.com | www.0591sf.com | www.97655y.com | 2021ddd.com | www.dy1188.com | www.9422j.com | 9895l.com | www.888vm.com | www.e63568.com | 50023366.com | www.6033i.com | www.js89v.vip | xianjinwanggg.com | 3016ccc.com | www.s4455.com | 112j.net | amjzh.top | www.78680h.com | 22995156.com | www.1882389.com | www.o98478.com | 5429k.com | www.hgcn88.com | www.3155hd.com | 4123rr.com | www.xam58.com | www.9928l.com | c9699c.com | www.1118kj.cc | www.865065.com | dzhcp2.com | www.99113e.com | www.168232.com | 87665g.com | www.7036e.com | 0812h.com | www.hg3636.com | www.89894p.com | 461653.com | www.88399.com | www.756398.com | 492uu.com | www.7893w32.com | nnn444000.com | www.kb9988.com | www.hg6767c.com | 00774jj.com | www.893333.com | www.754918.com | k86811.com | www.5700666.com | 6150d.com | www.3459x.com | www.18399.com | pj88nn.com | www.xycp099.com | 4136x.com | www.6kk.com | www.89894n.com | 0698o.com | www.http://www.410488.com/ | www.355242.com | 589669.com | www.4331r.com | 4880g.com | www.js00033.com | www.207881.com | www.81866m.com | www.09088.com | 2757e.com | www.6606488.com | 22299mm.com | www.39695s.com | www.1248i.cc | 55113356.com | www.30350z.com | 3544.am | www.78221g.com | www.530833.com | 21866i.com | www.87668q.com | 36407766.com | www.huangma27.com | 3121h.com | www.78k78.com | www.444083.com | 3424v.com | www.51331d.com | 9964f.com | www.32031b.com | 6403u.com | www.qmc0066.com | 8547w.com | www.330099p.com | www.770951.com | a77304.com | www.60007g.com | iii3405.com | www.837993.com | 64111s.com | www.7415.com | 66773885.com | www.077313.com | 2381rrr.com | www.1770q.com | www.347277.com | www.7720h.com | www.fh52.com | 8901x.com | www.35918t.com | 56787bb.com | www.6678578.com | 3648.com | www.23819.co | 2007893.com | www.4196g.com | 99567o.com | www.5446jj.com | 2776m.com | www.911137.com | 7792h.com | www.234894.com | 4630022.com | www.39333.com | 55331uu.com | www.21033.com | 36554.com | www.wns47.com | 1479a.com | www.14900c.com | 3189ff.com | www.07811.com |