#include<stdio.h> int main() { int len = 0; char c; while ((c = getchar()) != '\n') { len++; } printf("字符串的长度为:%d\n", len); return 0; }