• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            posts - 195,  comments - 30,  trackbacks - 0

            You have decided that PGP encryptation is not strong enough for your email. You have decided to supplement it by first converting your clear text letter into Pig Latin before encrypting it with PGP.

            Input and Output

            You are to write a program that will take in an arbitrary number of lines of text and output it in Pig Latin. Each line of text will contain one or more words. A ``word'' is defined as a consecutive sequence of letters (upper and/or lower case). Words should be converted to Pig Latin according to the following rules (non-words should be output exactly as they appear in the input):

            1. Words that begin with a vowel (a, e, i, o, or u, and the capital versions of these) should just have the string ``ay'' (not including the quotes) appended to it. For example, ``apple'' becomes ``appleay''.
            2. Words that begin with a consonant (any letter than is not A, a, E, e, I, i, O, o, U or u) should have the first consonant removed and appended to the end of the word, and then appending ``ay'' as well. For example, ``hello'' becomes ``ellohay''.
            3. Do not change the case of any letter.

            Sample Input

            This is the input.

            Sample Output

            hisTay isay hetay inputay.

             


            雖然題目難度不是很大,但是對我啟發挺大,碰到這種字符串處理的題,最好就是統一模式,
                              a=getchar():
                               while(flag)
                       {      while()//判斷是否符合條件
                             { ----   ,
                                    if((a=getchar())==EOF)//獲取a=getchar()
                                              flag=0;//判斷文件是否結束
                              }
                               while()//判斷是否符合條件
                             { ----   ,
                                    if((a=getchar())==EOF)//獲取a=getchar()
                                              flag=0;//判斷文件是否結束
                              }
                          }
            #include<iostream>
            #include
            <cstdlib>
            using namespace std;

              
            int main()
              {
             
            // freopen("s.txt","r",stdin);
             
            // freopen("key.txt","w",stdout);
              char a;
              
            int flag=0,e=1,mark;
              
            string temp;
              
            char mar;
              a
            =getchar();
              
            while (e)
              {
                       mark
            =0;
                        
            while((a>='a'&&a<='z')||(a>='A'&&a<='Z'))
                      {
                        temp
            ="ay";
                         
            if(flag==0)
                        {
                             flag
            ++;
                             
            if(a=='A'||a=='a'||a=='E'||a=='e'||a=='I'||a=='i'||a=='O'||a=='o'||a=='U'||a=='u')
                             cout
            <<a;
                             
            else 
                            {
                                mark
            =1;
                                mar
            =a;
                            }
                       }
                        
            else
                      cout
            <<a;
                      
            if((a=getchar())==EOF)
                            {
                                e
            =0;
                                
            break;
                             }    
                     }
                      
            if(mark==1)
                       {
                            cout
            <<mar;
                       }    
                      cout
            <<temp;
                       
            while(a<'A'||a>'z'||(a>'Z'&&a<'a'))
                       {
                            cout
            <<a;
                            
            if((a=getchar())==EOF)
                            {
                                e
            =0;
                                
            break;
                             }    
                       } 
                       flag
            =0;   
              }
              
            //system("PAUSE");
              return   0;
              }
            posted on 2009-07-03 18:04 luis 閱讀(612) 評論(0)  編輯 收藏 引用 所屬分類: 格式.輸入輸出.數據類型
            <2012年6月>
            272829303112
            3456789
            10111213141516
            17181920212223
            24252627282930
            1234567

            常用鏈接

            留言簿(3)

            隨筆分類

            隨筆檔案

            文章分類

            文章檔案

            友情鏈接

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            久久久久99这里有精品10| 久久久青草青青亚洲国产免观| 国产精品99久久久久久猫咪 | 久久噜噜电影你懂的| 国产伊人久久| 久久久久人妻一区二区三区 | 久久99免费视频| 久久高潮一级毛片免费| 色偷偷久久一区二区三区| 国产午夜精品理论片久久| 亚洲精品无码久久久久去q| 久久国产成人精品麻豆| 免费久久人人爽人人爽av| 亚洲一区二区三区日本久久九| 精品无码久久久久国产动漫3d | 日韩电影久久久被窝网| 99久久精品毛片免费播放| 亚洲综合精品香蕉久久网| 狠狠色丁香久久婷婷综合蜜芽五月| 久久久久亚洲AV成人片| 偷窥少妇久久久久久久久| 国产成人综合久久久久久| 97久久国产亚洲精品超碰热| 狠狠色丁香婷婷久久综合五月 | 无码人妻久久一区二区三区蜜桃 | 久久久久久久女国产乱让韩| 美女久久久久久| 久久AAAA片一区二区| yellow中文字幕久久网| 亚洲精品美女久久777777| 久久精品国产亚洲AV影院| 色老头网站久久网| 久久国产AVJUST麻豆| 国产毛片欧美毛片久久久| 久久久无码精品亚洲日韩蜜臀浪潮| 色天使久久综合网天天| 亚洲人成电影网站久久| 久久精品一本到99热免费| 麻豆AV一区二区三区久久| 成人国内精品久久久久一区| 久久久综合九色合综国产|