Вывести слова в предложении в обратном порядке — C++(Си)

#include <iostream>
#include <sstream>
#include <conio.h>
#include <string>
#include <stack>
 
using namespace std;
 
int main()
{
     string s;
     stack<string> st;
 
     getline(cin,s);
     stringstream in(s);
     while(in >> s)
         st.push(s);
     while(!st.empty())
     {
           cout << st.top() << ' ';
           st.pop();
     }
     getch();
}

Результат работы программы

10 Thoughts to “Вывести слова в предложении в обратном порядке — C++(Си)”

  1. Wow, amazing weblog format! How lengthy have you ever been running a blog
    for? you make blogging look easy. The whole look of your website is fantastic, let alone the content!
    You can see similar here dobry sklep

  2. My spouse and I stumbled over here from a different web
    page and thought I might as well check things out. I like what I see so i
    am just following you. Look forward to looking into your web page for
    a second time. I saw similar here: Najlepszy sklep

  3. Hello, Neat post. There’s an issue along with your site in web explorer, may test this?
    IE still is the market chief and a big element of people will leave out
    your wonderful writing due to this problem. I saw similar here: Ecommerce

  4. Hi! This is kind of off topic but I need some help from an established blog.
    Is it very hard to set up your own blog? I’m
    not very techincal but I can figure things out pretty quick.
    I’m thinking about creating my own but I’m not sure where to start.
    Do you have any points or suggestions? Appreciate it I saw similar here: E-commerce

  5. Hey there! Do you know if they make any plugins to assist with Search
    Engine Optimization? I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good gains.
    If you know of any please share. Cheers!
    You can read similar text here: Ecommerce

  6. It’s very interesting! If you need help, look here: ARA Agency

  7. Good day! Do you know if they make any plugins to
    assist with SEO? I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good success.
    If you know of any please share. Cheers! You can read similar
    text here: Sklep

  8. Hello there! Do you know if they make any plugins to assist with SEO?
    I’m trying to get my website to rank for some targeted keywords but I’m not seeing very good results.
    If you know of any please share. Many thanks! You can read
    similar blog here: Hitman.agency

  9. Hey there! Do you know if they make any plugins to help
    with SEO? I’m trying to get my blog to rank for some targeted keywords but I’m
    not seeing very good results. If you know of any please share.
    Thank you! You can read similar blog here: AA List

  10. Wow, incredible blog layout! How lengthy have you ever been running a blog for?
    you make running a blog look easy. The overall glance of your website is excellent,
    let alone the content material! You can see similar here sklep internetowy

Leave a Comment