Last active
February 18, 2020 15:09
-
-
Save Privilger/641299cee11eaf603e6c1996f4af606c to your computer and use it in GitHub Desktop.
C++大数运算去除前导0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
C++大数运算去除前导0 | |
vector<int> c; // c的数据类型 | |
如果要用c表示一个大数, eg: "123456" | |
则存储方式为(倒着存): | |
[6, 5, 4, 3, 2, 1] | |
*/ | |
while(c.size() > 1 && c.back() == 0) {c.pop_back();} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment