The power of STL for my entertainment:
Code:
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
string TheWord("I am a string!");
reverse(TheWord.begin(), TheWord.end());
cout<<TheWord<<endl;
return 0;
}
Code:
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main()
{
string TheWord("I am a string!");
string Reversed(TheWord); //sizing
reverse_copy(TheWord.begin(), TheWord.end(), Reversed.begin());
cout<<Reversed<<endl;
return 0;
}
Many variations to this code can be made. And all of them require an IQ of any one-cell organism
