• <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.

             


            雖然題目難度不是很大,但是對我啟發(fā)挺大,碰到這種字符串處理的題,最好就是統(tǒng)一模式,
                              a=getchar():
                               while(flag)
                       {      while()//判斷是否符合條件
                             { ----   ,
                                    if((a=getchar())==EOF)//獲取a=getchar()
                                              flag=0;//判斷文件是否結(jié)束
                              }
                               while()//判斷是否符合條件
                             { ----   ,
                                    if((a=getchar())==EOF)//獲取a=getchar()
                                              flag=0;//判斷文件是否結(jié)束
                              }
                          }
            #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 閱讀(620) 評論(0)  編輯 收藏 引用 所屬分類: 格式.輸入輸出.數(shù)據(jù)類型
            <2009年7月>
            2829301234
            567891011
            12131415161718
            19202122232425
            2627282930311
            2345678

            常用鏈接

            留言簿(3)

            隨筆分類

            隨筆檔案

            文章分類

            文章檔案

            友情鏈接

            搜索

            •  

            最新評論

            閱讀排行榜

            評論排行榜

            久久久久一区二区三区| 精品久久久久久无码专区| 欧美精品丝袜久久久中文字幕| 国产精品狼人久久久久影院| 人人狠狠综合久久亚洲高清| 少妇久久久久久久久久| 精品久久久久中文字| 波多野结衣AV无码久久一区| 国产精品久久影院| 狠狠色狠狠色综合久久| 国内精品伊人久久久久影院对白| 中文字幕无码免费久久| 色婷婷久久久SWAG精品| 久久国产精品偷99| 国产一区二区精品久久| 久久综合国产乱子伦精品免费| 色综合久久中文字幕综合网| 久久精品国产亚洲Aⅴ香蕉| 久久99国产亚洲高清观看首页| 日韩欧美亚洲综合久久| 久久亚洲国产成人精品无码区| 亚洲嫩草影院久久精品| 成人久久综合网| 看久久久久久a级毛片| 久久亚洲AV成人无码| 性高湖久久久久久久久AAAAA| 国产成人精品久久一区二区三区av | 久久中文娱乐网| 国产产无码乱码精品久久鸭| 久久夜色精品国产噜噜亚洲AV| 亚洲人成电影网站久久| 久久WWW免费人成—看片| 久久综合久久综合九色| 久久99国产亚洲高清观看首页| 2021少妇久久久久久久久久| 国产精品久久99| 999久久久免费国产精品播放| 国产成人久久精品麻豆一区| 婷婷久久综合九色综合98| 色综合久久中文综合网| 久久久久无码精品|