Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
133806 Kevin 利用指针编写strlen函数 C++ Accepted 2 MS 276 KB 251 2025-10-22 15:42:34

Tests(10/10):


Code:

#include<iostream> #include<cstring> using namespace std; int strlen(char a[]){ gets(a); int i=0,s=0; while(a[i]!='\0'){ s++; i++; } return s; } int main() { char b[1005]; gets(b); cout<<strlen(b); return 0; }