缘由大一初学者,书上习题-编程语言-CSDN问答 int w = 0, h = 0, n = 0; cin >> n; while (n)++w, h += n % 10, n /= 10; cout << w << "\t" << h << endl;