• <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 歲月流逝 閱讀(899) 評論(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;
            }
            久久中文精品无码中文字幕| 狠狠综合久久综合88亚洲| 青青草国产精品久久| 无码人妻少妇久久中文字幕| 亚洲色大成网站www久久九| 精品九九久久国内精品| 性欧美大战久久久久久久 | 国产精品免费看久久久| 精品视频久久久久| 国产精品久久毛片完整版| 日韩中文久久| 99久久精品久久久久久清纯| 77777亚洲午夜久久多人| 久久久久国产一级毛片高清板| 久久久久久无码Av成人影院| 亚洲国产精品无码久久久久久曰| 99久久er这里只有精品18| 久久综合久久综合亚洲| 久久久精品视频免费观看| 久久精品国产99国产电影网| 欧洲精品久久久av无码电影| 久久精品国产亚洲AV久| 久久精品桃花综合| 日本亚洲色大成网站WWW久久| 日韩亚洲欧美久久久www综合网| 久久国产亚洲高清观看| 中文字幕人妻色偷偷久久| 一本一本久久a久久综合精品蜜桃| 日本精品久久久久影院日本| 久久婷婷色综合一区二区| 久久人人爽人人精品视频| 国产精品久久久天天影视香蕉 | 久久久噜噜噜www成人网| 亚洲国产精品成人久久| 日韩精品久久久肉伦网站 | 久久精品这里只有精99品| 国産精品久久久久久久| 久久综合色之久久综合| 亚洲人成电影网站久久| 久久久一本精品99久久精品88| 97久久精品无码一区二区天美 |