• <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;
            }
            久久中文字幕人妻丝袜| 久久婷婷五月综合97色直播| 国产精品久久久久久久app| 久久天天躁狠狠躁夜夜不卡 | 欧美熟妇另类久久久久久不卡| 波多野结衣久久| 久久久久久久久久久久中文字幕| 91精品国产色综合久久| 国产精品女同一区二区久久| 久久男人AV资源网站| 久久午夜羞羞影院免费观看| 超级碰久久免费公开视频| 伊人久久大香线蕉无码麻豆| 久久精品国产亚洲精品2020| 26uuu久久五月天| 亚洲国产精品无码久久久不卡| 国产精品亚洲美女久久久| 国内精品久久久久久久久电影网| 国产精品福利一区二区久久| 美女久久久久久| 国产午夜免费高清久久影院| 热久久最新网站获取| 精品久久久久久久久久中文字幕 | 久久久噜噜噜久久中文字幕色伊伊| 久久国产亚洲精品无码| 亚洲AV伊人久久青青草原| 久久精品国产亚洲av高清漫画 | 亚洲乱码精品久久久久.. | 中文精品久久久久人妻不卡| 99久久精品国产毛片| 日韩av无码久久精品免费| 亚洲日本va午夜中文字幕久久| 久久综合丝袜日本网| 精品国产乱码久久久久久1区2区| 香蕉久久久久久狠狠色| 久久国产免费直播| 91超碰碰碰碰久久久久久综合| 国产午夜精品久久久久免费视| 日韩精品久久久久久久电影蜜臀| 思思久久精品在热线热| 精品久久亚洲中文无码|