How to use the reverse() function
1. Reverse function reverses string
string N;
cin>>N;
reverse(N.begin(), N.end());//begin & end;
2. The reverse function reverses the character array
char s[101];
cin.getline(s,sizeof(s)); //You can also do without cin.getline
int m=strlen(s);
reverse(s,s+m);
puts(s);
3. The reverse function reverses the integer array
int a[100];
reverse(a,a+10); //The second parameter is the next address of the last element of the array;
Read More:
- Reverse function: reverses container contents
- How to use C + + function pointer array
- IOS reverse error: use of undeclared identifier ‘mshookivar’
- How to use Python split() function (split array)
- 7. Reverse Integer [easy] (Python)
- Use of rep function in R
- nvalid default value for prop “params“: Props with type Object/Array must use a factory function to
- How to use Latex to Write Matrices
- Leetcode: 7. Reverse Integer(JAVA)
- Mybatis reverse problem failed to load ApplicationContext
- Codeworks educational round 96 [reverse pair] E. string reverse
- error: invalid use of non-static member function
- How to Use Subfigure in Latex
- The use of C + + template function and lambda expression
- error: ‘CLOCK_MONOTONIC‘ undeclared (first use in this function)
- How to Use Truffle to Deploy contracts on moonbeam
- C#: How to Use Httpclient to upload files with other parameters
- Nginx reverse proxy MySQL
- How to use C # to get image format without system. Drawing. Common
- 【Hackerrank】Reverse a doubly linked list