#include <iostream> using namespace std; int main() { char str[100] = { 0 }; cin.getline(str, sizeof(str)); // 输出字符串的长度 int len = 0; for (char *p = str; (*p) != '\0'; p++) len++; cout << len; return 0; }