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

             


            雖然題目難度不是很大,但是對(duì)我啟發(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 閱讀(618) 評(píng)論(0)  編輯 收藏 引用 所屬分類: 格式.輸入輸出.數(shù)據(jù)類型
            <2009年7月>
            2829301234
            567891011
            12131415161718
            19202122232425
            2627282930311
            2345678

            常用鏈接

            留言簿(3)

            隨筆分類

            隨筆檔案

            文章分類

            文章檔案

            友情鏈接

            搜索

            •  

            最新評(píng)論

            閱讀排行榜

            評(píng)論排行榜

            伊人久久精品无码av一区| 久久人人爽人人爽人人片AV麻烦| 亚洲国产精品嫩草影院久久| 蜜臀久久99精品久久久久久| 久久婷婷国产剧情内射白浆| 久久精品国产亚洲av水果派 | 91精品国产高清久久久久久国产嫩草 | 2022年国产精品久久久久| 国产精品热久久无码av| 亚州日韩精品专区久久久| 国产成人无码久久久精品一| 亚洲国产成人乱码精品女人久久久不卡| 日韩人妻无码一区二区三区久久99 | 精品国产一区二区三区久久| 伊色综合久久之综合久久| 久久精品成人免费网站| 思思久久好好热精品国产| 欧美久久综合性欧美| 精品多毛少妇人妻AV免费久久| 国内精品久久国产大陆| 伊人久久精品无码av一区| 久久精品国产精品亚洲人人| 国产精品对白刺激久久久| 一本久久知道综合久久| 日韩亚洲国产综合久久久| 久久99国产精品久久| 久久婷婷国产综合精品 | 日韩精品无码久久一区二区三| 热re99久久6国产精品免费| 色婷婷综合久久久久中文字幕| 99久久国语露脸精品国产| 亚洲精品无码久久久久sm| 一本大道久久东京热无码AV| 久久亚洲高清综合| 精品久久久久久无码免费| 浪潮AV色综合久久天堂| 国产成人精品综合久久久| 欧美激情一区二区久久久| 要久久爱在线免费观看| 午夜精品久久久久9999高清| 久久精品国产欧美日韩|