Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string.h>
- #include <stdlib.h>
- using namespace std;
- class P6{
- private:
- public:
- void run()
- {
- int k;
- cout << "Cate cuvinte ai: ";
- cin >> k;
- invers(k);
- cout << endl;
- system("PAUSE");
- }
- void invers(int k)
- {
- if (k > 0)
- {
- char word[255];
- cout << "Introduceti un cuvant: ";
- cin.get();
- cin.get(word, 255, '\n');
- invers(k-1);
- cout << word << " ";
- }
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement