• <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 歲月流逝 閱讀(893) 評論(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;
            }
            久久久久免费精品国产| 亚洲伊人久久成综合人影院 | 久久精品国产一区二区三区| 国产精品美女久久久久AV福利| 久久久国产精华液| 亚洲午夜久久久久妓女影院| 国产韩国精品一区二区三区久久| 99久久精品这里只有精品| 久久精品国产2020| 久久综合九色综合久99| 无码人妻久久一区二区三区蜜桃| 久久人人妻人人爽人人爽| 国产精品综合久久第一页 | 精品99久久aaa一级毛片| 亚洲人成电影网站久久| 久久国产精品久久国产精品| 久久国产色av免费看| 久久亚洲国产成人影院网站| av无码久久久久久不卡网站| 亚洲人成网站999久久久综合 | 久久亚洲精品视频| 久久国产色av免费看| 久久久久无码中| 91亚洲国产成人久久精品| 亚洲综合伊人久久综合| 中文字幕精品无码久久久久久3D日动漫| 久久久久亚洲AV成人片 | 久久综合日本熟妇| 久久亚洲欧美国产精品 | 99久久精品免费观看国产| 国产成人精品久久| 精品久久久久久久久免费影院| 国产精品久久成人影院| 久久久久久久久无码精品亚洲日韩 | 久久99精品国产麻豆宅宅| 国产精品99久久不卡| 亚洲国产精品婷婷久久| 久久久久四虎国产精品| 国产一区二区精品久久凹凸| 91精品国产高清91久久久久久| 青青草原精品99久久精品66|