Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
27953 | 唐心 | 反转字符串 | C++ | Accepted | 2 MS | 712 KB | 273 | 2022-06-12 18:44:21 |
#include<iostream> #include<cstring> using namespace std; int main(){ int n,i; char *a = new char[101]; memset(a,0,sizeof(char)*101); gets(a); n = strlen(a); for(i = n-1;i >= 0; i--) { cout <<a[i]; } cout << endl; delete [] a; return 0; }