Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
15034 | 仇翌楷 | 利用指针编写strlen函数 | C++ | Accepted | 3 MS | 716 KB | 212 | 2021-07-10 19:51:52 |
#include <bits/stdc++.h> using namespace std; int mystrlen(char* p) { int i = 0; while (*(p + i) != '\0') i++; return i; } int main() { char a[1005]; gets(a); cout << mystrlen(a); return 0; }