This is not supported under the UVA compiler right?
Then what's the fastest code to do this in C/C++?
And if I use standard string class how can I made this?
strrev()
Moderator: Board moderators
strrev()
My own quote:
We are here as Adam and Eve were here!
We are here as Adam and Eve were here!
-
- Learning poster
- Posts: 54
- Joined: Sun Oct 28, 2001 2:00 am
- Location: Bangladesh
for reversing any sequence you can use the STL algorithm function
std::reverse requries to #include<algorithm>
std::reverse(beginning_iterator, ending_iterator);
so for
and for
Or you can always use the handwritten function given by sohel.[/code]
std::reverse requries to #include<algorithm>
std::reverse(beginning_iterator, ending_iterator);
so for
Code: Select all
char a[10]; => std::reverse(a, a + 10);
Code: Select all
string s; => std::reverse(s.begin(), s.end());