📜  c#代码示例中两个数字的总和

📅  最后修改于: 2022-03-11 14:48:41.251000             🧑  作者: Mango

代码示例2
int num = 123;
int sum = 0;
while(num > 0)
{
  sum += number % 10;
  num /= 10;
}
Console.WriteLine(sum); // output: 6