ysh 杨书蘅 · 发布于 2024-11-27 · 浏览 586 回复 0 include <bits/stdc++.h> using namespace std; int main() { int a, b, d = 0; scanf("%d", &a); while (a != 0) { b = a % 10; d = d + b; a = a / 10; } printf("%d", d); return 0; }