啊啊啊 阮 · 发布于 2024-11-27 · 浏览 533 回复 0 include <stdio.h> using namespace std; int main () { int a, b, s = 0, n; scanf("%d", &n); while (n != 0) { b = n % 10; s = s + b; n = n / 10; } printf("%d", s); return 0; }