54. /// </summary>
55. /// <param name="s1"></param>
56. /// <param name="s2"></param>
57. /// <returns></returns>
58. public static string LongNumberAdd(string s1, string s2)
59. {
60. string result = "";
61. if (s1.Length > s2.Length)
62. {
63. result = AddToResult(s1, s2);
64. }
65. else
66. {
67. result = AddToResult(s2, s1);
68. }
69. return result;
70. }
71. /// <summary>
72. /// 长的加短的
73. /// </summary>
74. /// <param name="s1">长的数</param>
75. /// <param name="s2">短的数</param>
76. /// <returns></returns>
77. private static string AddToResult(string s1, string s2)
78. {
79. var len = s1.Length - s2.Length;
80. int temp = 0;
81. StringBuilder sb = new StringBuilder();
82. for (int i = s1.Length - 1; i >= 0; i--)
83. {
84. int s;
85. &n
上一页 [1] [2] [3] [4] [5] 下一页