• <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 - 7, comments - 13, trackbacks - 0, articles - 37
               :: 首頁 :: 新隨筆 :: 聯系 ::  :: 管理

            1062 Text Reverse

            Posted on 2008-10-09 19:32 歲月流逝 閱讀(897) 評論(0)  編輯 收藏 引用

            Text Reverse

            Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
            Total Submission(s): 1391    Accepted Submission(s): 577


            Problem Description
            Ignatius likes to write words in reverse way. Given a single line of text which is written by Ignatius, you should reverse all the words and then output them.
             

            Input
            The input contains several test cases. The first line of the input is a single integer T which is the number of test cases. T test cases follow.
            Each test case contains a single line with several words. There will be at most 1000 characters in a line.
             

            Output
            For each test case, you should output the text which is processed.
             

            Sample Input
            3
            olleh !dlrow
            m'I morf .udh
            I ekil .mca
             

            Sample Output
            hello world!
            I'm from hdu.
            I like acm.
            
            Hint
            Remember to use getchar() to read '\n' after the interger T, then you may use gets() to read a line and process it.
             

            Author
            Ignatius.L
             
            #include <stdio.h>
            #include <string.h>
            int main()
            {
                int i=0,n,length,t,j;
                char ch,p[1001],temp;
                scanf("%d",&n);
                ch=getchar();
                while(n--)
                {
                    gets(p);
                    length=strlen(p);
                    t=0;
                    for(i=0;i<=length;i++)
                    {
                        if(p[i]==' '||p[i]=='\0')
                        {
                           for(j=t;j<(i+t)/2;j++)
                        {
                            temp=p[j];
                            p[j]=p[i-j+t-1];
                            p[i-j+t-1]=temp;
                        }
                        t=i+1;
                        }
               
                    }   
                    printf("%s\n",p);
               
                }
                return 0;
            }
            精品99久久aaa一级毛片| 国产成人精品久久| 久久久国产精品网站| 2021久久国自产拍精品| 国产 亚洲 欧美 另类 久久| 国产福利电影一区二区三区久久老子无码午夜伦不 | 久久婷婷人人澡人人爽人人爱| 久久人妻少妇嫩草AV蜜桃| 久久超碰97人人做人人爱| 国产日韩久久免费影院| 伊人久久精品无码二区麻豆| 麻豆精品久久久一区二区| 欧美日韩久久中文字幕| 狠狠色噜噜狠狠狠狠狠色综合久久| 久久e热在这里只有国产中文精品99 | 久久婷婷人人澡人人| 久久精品国产亚洲av高清漫画| 国产91久久综合| 久久超碰97人人做人人爱| 热99RE久久精品这里都是精品免费 | 久久久亚洲欧洲日产国码是AV| 日韩精品国产自在久久现线拍| 久久伊人五月丁香狠狠色| 国产伊人久久| 一级做a爰片久久毛片人呢| 久久精品一区二区三区AV| 国产精品欧美亚洲韩国日本久久| 亚洲欧美成人综合久久久| 国产一区二区久久久| 亚洲人AV永久一区二区三区久久 | 伊人久久大香线蕉综合热线| 国产精品成人99久久久久 | 欧美久久久久久| 午夜精品久久久久久影视777| segui久久国产精品| 91久久精品国产免费直播| 久久精品国产半推半就| 久久国产色AV免费看| 高清免费久久午夜精品| 久久超碰97人人做人人爱| 久久久久99精品成人片欧美|