Odwracanie tekstu
Program uwzględnia także przy odwracaniu wielkość liter.
Kompilator: Dev C++
//Odwracanie tekstu - funkcje
#include <cstdlib>
#include <iostream>
#include <string>
using namespace std;
void wspak(string txt);
int main(int argc, char *argv[])
{
string text;
cout<<"Podaj tekst: ";
getline(cin, text);
wspak(text);
cout<<"\n";
system("PAUSE");
return EXIT_SUCCESS;
}
void wspak(string txt)
{
cout<<"Wspak:\n";
for(int i=txt.length()-1;i>=0;i--)
cout<<txt[i];
};