Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
14999 | 林子翔 | 反转字符串 | C++ | Accepted | 3 MS | 696 KB | 322 | 2021-07-10 15:57:02 |
#include <iostream> #include <cstdio> #include <cstring> using namespace std; char a[101], b[101]; int main() { gets(a); int len = strlen(a); char *p = &a[len - 1]; for (int i = 0; i < len; i++) { b[i] = *(p - i); } p = b; for (int i = 0; i < strlen(b); i++) { cout << *(p + i); } return 0; }