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

获取字符串长度

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

#include <iostream>
using namespace std;

int main() {

	char str[100] = {  };
	char * p = str;
	cin.getline(str, sizeof(str));

	 //write your code here......
	int count = 0;
	while (*(p++))
	{
		count++;
	}
	cout << count;
	

	return 0;
}
全部评论

相关推荐

好消息是活的像个人了,周末可以约会吃饭打游戏了坏消息是钱没了,当初来小红书就是为了钱啊哭笑不得😭
犯困嫌疑人:好事儿啊,取消大小周能有更多自己的时间,周末还能约对象玩,这不美滋滋?
投递小红书等公司6个岗位 > 小红书取消大小周
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务