• <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 歲月流逝 閱讀(903) 評論(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;
            }
            人妻精品久久久久中文字幕| 久久www免费人成精品香蕉| 精品久久无码中文字幕| 热99re久久国超精品首页| 无码任你躁久久久久久| 国产精品无码久久综合| 久久久久久无码国产精品中文字幕| 久久久久亚洲AV成人网| 中文字幕人妻色偷偷久久| 久久AAAA片一区二区| 久久精品国产99久久无毒不卡 | 国内精品久久久久国产盗摄| 欧美日韩精品久久久免费观看| 国产精品久久久久久福利漫画| 99久久国产亚洲综合精品| 99久久伊人精品综合观看| 亚洲级αV无码毛片久久精品| 色婷婷综合久久久久中文字幕| 久久国产免费观看精品| 久久99国产综合精品| 精品伊人久久大线蕉色首页| 日本久久中文字幕| 久久精品国产99久久香蕉| 亚洲嫩草影院久久精品| 久久精品国产一区| 久久99热精品| 国产精品久久国产精麻豆99网站| 日韩av无码久久精品免费| 久久精品日日躁夜夜躁欧美| 亚洲精品无码久久久久AV麻豆| 久久久久国产| 蜜桃麻豆www久久国产精品| 91精品国产91久久久久久| 亚洲国产精品热久久| 国产精品99久久精品爆乳| Xx性欧美肥妇精品久久久久久| 伊人久久综合热线大杳蕉下载| 国产精品99久久久久久董美香| 久久中文字幕无码专区| 久久亚洲精品无码aⅴ大香| 日日躁夜夜躁狠狠久久AV|