Всем спасибо. Я сделал еще так:
C++ |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
| #include "stdafx.h"
#include <iostream>
#include "conio.h"
#include "windows.h"
#include <iomanip>
using namespace std;
void reverse (char *s);
// Вывод начальных данных
int main()
{
char str [] = "Hello My Dear Friend";
cout << str << endl;
_getch();
reverse (str);
return 0;
}
// Вывод строки в обратном порядке
void reverse (char *s)
{
if (*s)
reverse (s+1);
else
return;
cout << *s;
_getch();
} |
|