• <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;
            }
            久久久久久亚洲精品不卡 | 亚洲伊人久久综合中文成人网| 久久免费线看线看| 久久影视综合亚洲| 久久免费的精品国产V∧| 国产69精品久久久久99| 久久久久亚洲AV无码观看 | 国产精品美女久久久m| 久久久久亚洲AV综合波多野结衣| 久久人人爽人人爽人人av东京热| 久久香蕉综合色一综合色88| 一本大道久久香蕉成人网| 久久青青草原国产精品免费| 久久99精品久久久大学生| 久久久久无码专区亚洲av| 亚洲AV无码成人网站久久精品大| 国产亚州精品女人久久久久久 | 久久精品人人做人人爽电影| 97久久精品人人澡人人爽| 囯产极品美女高潮无套久久久| 很黄很污的网站久久mimi色| 丁香狠狠色婷婷久久综合| 久久久久久久精品成人热色戒| 久久综合视频网站| 国产午夜精品久久久久九九电影| 精品国产VA久久久久久久冰 | 国产精品久久亚洲不卡动漫| 一级做a爰片久久毛片免费陪| 很黄很污的网站久久mimi色| 久久国产精品99国产精| 久久久久亚洲av成人网人人软件| 亚洲人成无码网站久久99热国产| 国产免费久久精品丫丫| 88久久精品无码一区二区毛片| 国产精品一久久香蕉产线看 | 欧美久久久久久| 久久婷婷五月综合色99啪ak | 亚洲女久久久噜噜噜熟女| 97精品伊人久久大香线蕉| 国内精品伊人久久久久妇| 婷婷久久五月天|