using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Bigadd
{
public class BigClass
{
public void BigADD(string x, string y, out string result)
{
int len = 0;
if (x.Length < y.Length)
{
len = y.Length;
x = x.PadLeft(len, '0');
}
else
{
len = x.Length;
y = y.PadLeft(len, '0');
}
int tmp = 0; //进位
result = "";
//进位~~
for (int i = len - 1; i >= 0; i--)
{
int a = Convert.ToInt32(Convert.ToString(x[i]));
int b = Convert.ToInt32(Convert.ToString(y[i]));
int sum = a + b + tmp;
result = Convert.ToString(sum % 10) + result;
tmp = sum / 10;
}
string strtmp = result;
if (strtmp.Substring (0, 1) =="0")
{
result = "1" + result;
}
}
}
}