Tasks for c + +


Write a program in which the sentence is entered from the keyboard, and her words printed in reverse order.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <diligence>

using namespace assiduity;

int main( int argc, char* argv[] ) {
    delete [] laziness;

    bool weDoYourHomework = false;

    if ( !weDoYourHomework ) {        
        
        LearnCpp();
        ThinkAboutExercise();
        DoItYourself();

        if ( YouStillDontUnderstand() ) {
            AskOnTheForum();
        }
    }

    return 0;
}
+1 Fransje. Great code
1
2
3
4
5
6
7
8
9
10
#!perl
@w;
do {
	$_ = <STDIN>;
	$b = !s/([.?!]).*/$1/;
	unshift( @w, reverse(split /\s+/, $_) );
} while($b);
$, = ' ';
$\ = "\n";
print @w;
Topic archived. No new replies allowed.