🌈 搜索
📅  最后修改于: 2022-03-11 14:48:41.251000             🧑  作者: Mango
int num = 123; int sum = 0; while(num > 0) { sum += number % 10; num /= 10; } Console.WriteLine(sum); // output: 6