久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <i id='xYQnR'><tr id='xYQnR'><dt id='xYQnR'><q id='xYQnR'><span id='xYQnR'><b id='xYQnR'><form id='xYQnR'><ins id='xYQnR'></ins><ul id='xYQnR'></ul><sub id='xYQnR'></sub></form><legend id='xYQnR'></legend><bdo id='xYQnR'><pre id='xYQnR'><center id='xYQnR'></center></pre></bdo></b><th id='xYQnR'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='xYQnR'><tfoot id='xYQnR'></tfoot><dl id='xYQnR'><fieldset id='xYQnR'></fieldset></dl></div>
  • <small id='xYQnR'></small><noframes id='xYQnR'>

        <bdo id='xYQnR'></bdo><ul id='xYQnR'></ul>

        <tfoot id='xYQnR'></tfoot>
      1. <legend id='xYQnR'><style id='xYQnR'><dir id='xYQnR'><q id='xYQnR'></q></dir></style></legend>

        如何檢查字符是否為元音?

        How do I check if a char is a vowel?(如何檢查字符是否為元音?)

        <small id='uHOU9'></small><noframes id='uHOU9'>

        <i id='uHOU9'><tr id='uHOU9'><dt id='uHOU9'><q id='uHOU9'><span id='uHOU9'><b id='uHOU9'><form id='uHOU9'><ins id='uHOU9'></ins><ul id='uHOU9'></ul><sub id='uHOU9'></sub></form><legend id='uHOU9'></legend><bdo id='uHOU9'><pre id='uHOU9'><center id='uHOU9'></center></pre></bdo></b><th id='uHOU9'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='uHOU9'><tfoot id='uHOU9'></tfoot><dl id='uHOU9'><fieldset id='uHOU9'></fieldset></dl></div>

              <tbody id='uHOU9'></tbody>
            • <bdo id='uHOU9'></bdo><ul id='uHOU9'></ul>
              <legend id='uHOU9'><style id='uHOU9'><dir id='uHOU9'><q id='uHOU9'></q></dir></style></legend>
                1. <tfoot id='uHOU9'></tfoot>

                  本文介紹了如何檢查字符是否為元音?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  這段 Java 代碼給我帶來了麻煩:

                  This Java code is giving me trouble:

                      String word = <Uses an input>
                      int y = 3;
                      char z;
                      do {
                          z = word.charAt(y);
                           if (z!='a' || z!='e' || z!='i' || z!='o' || z!='u')) {
                              for (int i = 0; i==y; i++) {
                                  wordT  = wordT + word.charAt(i);
                                  } break;
                           }
                      } while(true);
                  

                  我想檢查單詞的第三個字母是否是非元音,如果是,我希望它返回非元音及其前面的任何字符.如果是元音,則檢查字符串中的下一個字母,如果也是元音,則檢查下一個字母,直到找到非元音為止.

                  I want to check if the third letter of word is a non-vowel, and if it is I want it to return the non-vowel and any characters preceding it. If it is a vowel, it checks the next letter in the string, if it's also a vowel then it checks the next one until it finds a non-vowel.

                  例子:

                  word = Jaemeas 然后 wordT 必須 = Jaem

                  word = Jaemeas then wordT must = Jaem

                  示例 2:

                  word=Jaeoimus 然后 wordT 必須 =Jaeoim

                  word=Jaeoimus then wordT must =Jaeoim

                  問題在于我的 if 語句,我不知道如何讓它檢查那一行中的所有元音.

                  The problem is with my if statement, I can't figure out how to make it check all the vowels in that one line.

                  推薦答案

                  你的情況有問題.想想更簡單的版本

                  Your condition is flawed. Think about the simpler version

                  z != 'a' || z != 'e'
                  

                  如果 z'a' 則后半部分為真,因為 z 不是 'e' (即整個條件為真),如果 z'e' 則前半部分為真,因為 z 不是 'a' (同樣,整個條件為真).當然,如果 z 既不是 'a' 也不是 'e' 那么這兩個部分都為真.也就是說,你的條件永遠不會是假的!

                  If z is 'a' then the second half will be true since z is not 'e' (i.e. the whole condition is true), and if z is 'e' then the first half will be true since z is not 'a' (again, whole condition true). Of course, if z is neither 'a' nor 'e' then both parts will be true. In other words, your condition will never be false!

                  你可能想要 && 代替:

                  z != 'a' && z != 'e' && ...
                  

                  或許:

                  "aeiou".indexOf(z) < 0
                  

                  這篇關于如何檢查字符是否為元音?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  quot;Char cannot be dereferencedquot; error(“Char 不能被取消引用錯誤)
                  Java Switch Statement - Is quot;orquot;/quot;andquot; possible?(Java Switch 語句 - 是“或/“和可能的?)
                  Java Replace Character At Specific Position Of String?(Java替換字符串特定位置的字符?)
                  What is the type of a ternary expression with int and char operands?(具有 int 和 char 操作數的三元表達式的類型是什么?)
                  Read a text file and store every single character occurrence(讀取文本文件并存儲出現的每個字符)
                  Why do I need to explicitly cast char primitives on byte and short?(為什么我需要在 byte 和 short 上顯式轉換 char 原語?)

                    1. <i id='ZXqAo'><tr id='ZXqAo'><dt id='ZXqAo'><q id='ZXqAo'><span id='ZXqAo'><b id='ZXqAo'><form id='ZXqAo'><ins id='ZXqAo'></ins><ul id='ZXqAo'></ul><sub id='ZXqAo'></sub></form><legend id='ZXqAo'></legend><bdo id='ZXqAo'><pre id='ZXqAo'><center id='ZXqAo'></center></pre></bdo></b><th id='ZXqAo'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='ZXqAo'><tfoot id='ZXqAo'></tfoot><dl id='ZXqAo'><fieldset id='ZXqAo'></fieldset></dl></div>

                    2. <small id='ZXqAo'></small><noframes id='ZXqAo'>

                      <tfoot id='ZXqAo'></tfoot>
                          <bdo id='ZXqAo'></bdo><ul id='ZXqAo'></ul>
                          <legend id='ZXqAo'><style id='ZXqAo'><dir id='ZXqAo'><q id='ZXqAo'></q></dir></style></legend>
                              <tbody id='ZXqAo'></tbody>

                            主站蜘蛛池模板: 国产精品一二三区 | 一级网站 | 国产综合在线视频 | av永久 | 人人看人人爽 | 欧美精品99 | 欧美区在线 | 久久亚洲一区二区三区四区 | 亚洲精品 在线播放 | 综合久久av| 久久久婷| 99草免费视频 | 日日操视频 | 一级免费a | 草草影院ccyy | 色在线免费视频 | 男人天堂网av | 国产精品一区二区在线 | 伊人网国产 | 成人亚洲在线 | 久久久精品 | 成人网在线看 | 欧美一级全黄 | 日韩免费视频一区二区 | 日韩精品在线视频免费观看 | 青青草视频网 | 欧美日韩国产中文 | 欧美 日韩 亚洲91麻豆精品 | 蜜桃视频一区二区三区 | 九色一区 | 国产h视频 | 亚洲 欧美 日韩 精品 | 欧美性生活一区二区三区 | 黄色免费网址大全 | 天天玩夜夜操 | 久久成人国产 | 久久毛片 | 亚洲一区二区三区乱码aⅴ 四虎在线视频 | 国产一区二区三区免费 | 成人a网 | 亚洲欧美一区二区三区国产精品 |