• <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 歲月流逝 閱讀(903) 評論(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;
            }
            99久久国产亚洲高清观看2024| 热久久这里只有精品| 99久久综合国产精品免费| 久久成人国产精品免费软件| 久久精品www人人爽人人| 久久国产精品99久久久久久老狼| 亚洲精品高清国产一久久| 欧美一级久久久久久久大片| 久久国产色AV免费观看| 久久国产精品免费一区二区三区| 久久久久亚洲av成人网人人软件| 久久成人国产精品二三区| 亚洲av成人无码久久精品| 香蕉久久AⅤ一区二区三区| 久久精品国产亚洲沈樵| 亚洲国产精品久久电影欧美| 亚洲欧美久久久久9999| 亚洲日本va午夜中文字幕久久| 国产精品九九九久久九九| 久久久亚洲欧洲日产国码二区| 伊人久久国产免费观看视频| 久久精品国产99国产精品| 精品久久久久久久久中文字幕| 精品国产99久久久久久麻豆| 中文字幕无码久久人妻| 精品国产婷婷久久久| 99久久成人18免费网站| 国产精品久久久99| 色综合久久综精品| 狠狠人妻久久久久久综合蜜桃| 中文字幕一区二区三区久久网站| 国产精品久久99| 久久精品成人国产午夜| 久久综合狠狠综合久久激情 | 日本久久久精品中文字幕| 久久精品嫩草影院| 国产成人久久777777| 国产精品欧美久久久久无广告 | 亚洲中文字幕无码久久2020| 婷婷久久综合九色综合九七| 一级女性全黄久久生活片免费 |