Analysis of Pat computer problems in Zhejiang University 1009. Reverse speech (20)

Source: Internet
Author: User
1009. Reverse talk (20) Time Limit 400 ms memory limit 32000 KB Code The length is limited to 8000. Program Standard Author: Chen, Yue

To give an English sentence, you must write a program to output all the words in the sentence in reverse order.

Input Format:The test input contains a test case that contains a string of no more than 80 characters in a row. A string consists of several words and spaces. A word is a string consisting of uppercase and lowercase letters. Words are separated by one space, enter no extra spaces at the end of the sentence.

Output Format:The output of each test case occupies one line and the inverted sentence is output.

Input example:

 
Hello world here I come

Output example:

 
Come I here world Hello
 
 
 
 # include 
   
     # include 
    
      # include 
     
       using namespace STD; int main () {bool flag = false; stack 
      
        S; string STR; while (CIN> Str) s. push (STR); While (! S. empty () {If (FLAG) cout <""; else flag = true; cout 
        
        

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.