#include <iostream>
#include <string>
#include <windows.h>
using namespace std;
int main() {
    string word;
    int count = 0;
    int length = 0;

    cout << "请输入任意多行:" << endl;
    while (1) {
        if (!(getline(cin,word))) {
            break;
        }
        count++;
        length += word.length();
    }
    cout << "一共有" << count << "" << endl;
    cout << "一共有" << length << "个字符" << endl;
    system("pause");
    return 0;
}

 

posted on 2022-08-13 17:05  wshidaboss  阅读(415)  评论(0编辑  收藏  举报