#include <iostream>
using namespace std;
#include <string>
int main() {
//以下两行代码是c语言风格的代码,不兼容c++
// char str[100] = { 0 };
// cin.getline(str, sizeof(str));
//以下两行代码是C++风格的
string str;
getline(cin,str);
// write your code here......
//在C++风格的代码下,方法1
// size_t len = str.length();
//在C++风格的代码下,方法2
size_t len = str.size();
cout << len << endl;
return 0;
}

京公网安备 11010502036488号