public void TestDefaultConstructor() { BigInt bi = new BigInt(); Assert.AreEqual( "0", bi.ToString() ); }
public void TestAdd( string a, string b, string expected ) { BigInt bi = new BigInt( a ); bi.Add( b ); Assert.AreEqual( expected, bi.ToString() ); }
public void TestConstructor( string value, string expected ) { BigInt bi = new BigInt( value ); Assert.AreEqual( expected, bi.ToString() ); }
public long Solve() { try { BigInt sum = new BigInt(); foreach ( string number in _numbers ) { sum.Add(number); } string value = sum.ToString(); value = value.Substring( 0, 10 ); return long.Parse( value ); } catch ( Exception e ) { Console.WriteLine( e ); } return 0; }