How about: >>> 'hello world'[::-1] 'dlrow olleh'. This is extended slice syntax. It works by doing [begin:end:step] - by leaving begin and end off and ... ... <看更多>
Search
Search
How about: >>> 'hello world'[::-1] 'dlrow olleh'. This is extended slice syntax. It works by doing [begin:end:step] - by leaving begin and end off and ... ... <看更多>
g++ string-reverse.cpp -o a.out #include <iostream> #include <string> using namespace std; void swap(char *x, char *y) { char tmp = *x; ... <看更多>
... <看更多>