• <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中文出轨人妻| 久久久久高潮综合影院| 久久久久亚洲AV无码专区体验| 久久精品aⅴ无码中文字字幕不卡 久久精品aⅴ无码中文字字幕重口 | 欧美精品丝袜久久久中文字幕 | 亚洲国产精品无码久久| 久久久老熟女一区二区三区| 亚洲国产成人久久综合一| 狠狠色丁香婷婷久久综合五月| 91精品国产9l久久久久| 香蕉久久久久久狠狠色| 色综合久久天天综合| 午夜精品久久久久久久| 久久久99精品一区二区| 久久精品国产精品亚洲精品 | 久久99精品久久久久久不卡 | 久久久国产一区二区三区| 蜜臀久久99精品久久久久久小说 | 久久久久亚洲av综合波多野结衣 | 国内精品久久国产| 久久r热这里有精品视频| 思思久久精品在热线热| 久久伊人色| 国产午夜精品理论片久久 | 久久亚洲精品人成综合网| 久久人搡人人玩人妻精品首页| 中文字幕成人精品久久不卡| 77777亚洲午夜久久多喷| 午夜精品久久久久久99热| 久久99九九国产免费看小说| 精品一久久香蕉国产线看播放| 婷婷久久综合九色综合98| 亚洲狠狠婷婷综合久久蜜芽| 97精品国产97久久久久久免费| 久久成人小视频| 亚洲中文字幕无码一久久区| 亚洲AV日韩精品久久久久久久| 伊人久久久AV老熟妇色| 中文字幕人妻色偷偷久久| 久久精品国产亚洲av水果派 |