题解 | #获取字符串长度#

获取字符串长度

https://www.nowcoder.com/practice/9a2d212d23f5436c80607d5e68c6d12a

#include <iostream>
using namespace std;
#include <string.h>
int main() {
    char arr[100];
    cin.get(arr,100);
    int count=0;
    char *p=arr;
    for(int i=0;i<strlen(p);i++)
    {
        count++;
    }
    cout<<count;
    return 0;
}

全部评论

相关推荐

不愿透露姓名的神秘牛友
10-11 19:51
已编辑
点赞 评论 收藏
分享
爱吃烤肠的牛油最喜欢...:50K是ssp了估计,ssp的人家多厉害都不用说,每年比例大概在百分之5左右
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务