43. Multiply Strings(string模拟大数乘法)
Given two numbers represented as strings,return multiplication of the numbers as a string. Note:
Subscribe?to see which companies asked this question 分析: ac代码: class Solution { public: //模拟手算从最后一位开始处理? //进位? //转换成字符串? //前导0 ? ? ? ? for(i=0;i<L;i++) ? ? ? ? { ? ? ? ? ? ? if(rets[i]!='0') ? ? ? ? ? ? ? ? break; ? ? ? ? } ? ? ? ? if(i==L) ? ? ? ? ? ? return "0"; ? ? ? ? return rets.substr(i,L-i); ? ? } }; (编辑:ASP站长) 【免责声明】本站内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。 |
-
无相关信息