Create string-reverse.cpp (#113)

* Create string_reverse.cpp

* Update string_reverse.cpp

* Rename string_reverse.cpp to string-reverse.cpp

following the naming convention of the repository

* docs: update string index readme

add string-reversal in the string index readme

Co-authored-by: Arsenic <54987647+Arsenic-ATG@users.noreply.github.com>
pull/120/head
Hazel Mahajan 2021-03-26 19:36:39 +05:30 committed by GitHub
parent 29cbbeaf11
commit 3168e2f6c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -7,6 +7,7 @@
3. [KMP String Searching](c-or-cpp/kmp.cpp) 3. [KMP String Searching](c-or-cpp/kmp.cpp)
4. [Rabin Karp String Searching](c-or-cpp/rabin-karp.cpp) 4. [Rabin Karp String Searching](c-or-cpp/rabin-karp.cpp)
5. [String Tokeniser](c-or-cpp/string-tokeniser.cpp) 5. [String Tokeniser](c-or-cpp/string-tokeniser.cpp)
6. [String Reversal](c-or-cpp/string-reverse.cpp)
### C# ### C#

View File

@ -0,0 +1,12 @@
#include <iostream>
#include<string>
#include<algorithm>
using namespace std;
int main() {
string s;
cin>>s;
reverse(s.begin(),s.end());
cout<<s;
return 0;
}