- Cách 1: Tự viét hàm
// A Simple C++ program to reverse a string #include<bits/stdc++.h> using namespace std; // Function to reverse a string void reverseStr(string &str) { int n = str.length(); // Swap character starting from two // corners for (int i=0; i<n/2; i++) swap(str[i], str[n-i-1]); } // Driver program int main() { string str = "geeksforgeeks"; reverseStr(str); cout << str; return 0; }- Cách 2: Dùng hàm có sẵn:
// A quickly written program for reversing a string // using reverse() #include<bits/stdc++.h> using namespace std; int main() { string str = "geeksforgeeks"; // Reverse str[beign..end] reverse(str.begin(),str.end()); cout << str; return 0; }
According to Stanford Medical, It's in fact the SINGLE reason women in this country get to live 10 years longer and weigh 42 pounds lighter than we do.
Trả lờiXóa(And really, it is not about genetics or some secret diet and absolutely EVERYTHING to do with "how" they eat.)
P.S, I said "HOW", not "what"...
TAP this link to see if this little quiz can help you find out your true weight loss potential