Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
3249 | 孙浚轩 | 利用指针编写strlen函数 | C++ | Accepted | 0 MS | 256 KB | 241 | 2024-04-28 12:19:45 |
#include<iostream> using namespace std; int stringlen(char *s) { const char *p=s; while(*p) p++; return p-s; } int main() { char s[1000]; cin>>s; int lens=stringlen(s); cout<<lens; return 0; }