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