class Program
{
static void Main(string[]
args)
{
int a =
Int32.Parse(Console.ReadLine());//题目是小学生算数,两个数相加,求需要多少次进位,整数不超过9位
int b =
Int32.Parse(Console.ReadLine());
int c = 0;
int d = 0;
for (int i = 9; i >= 0;
i--)
{
c = (a % 10 + b % 10 + c) > 9 ? 1 :
0;
d +=
c;
a /=
10;
b /= 10;
}
Console.WriteLine("{0}",d);
Console.ReadKey();
}
}
原文:http://www.cnblogs.com/HorseKing/p/3550614.html