string P (string & num,string add){
int g=0;
if(num.length()<add.length()){
string t=num;
num=add;
add=t;
}
string t (num.length()-add.length(),'0');
add= t+add;
int len1=num.length(),len2=add.length();
for(int i=len1-1;i>=0;i--){
int t=((num[i]-'0') +(add[i]-'0') + g);
num[i]=t%10+'0';
g=t/10;
}
if(g!=0){
num.insert(0,string(1,(char)g+'0'));
}
return num;
}
Read More:
- The use of C + + template function and lambda expression
- [C + +] G + + compiler class template error message: template argument 1 is invalid
- Vue report failed to mount component: template or render function not defined
- An error happened during template parsing (template: “class path resource
- Python conversion hex to string, high and low data processing
- Java connection zookeeper high availability hive error
- The route addition failed: Either the interface index is wrong or the gateway do es not lie on the s
- Solve the problem that the version of less is too high
- Location and optimization of server IO high problem
- How to use high version OpenGL under Windows
- Solution to unbalanced load of multiple cards (GPU’s 0 card is too high) in Python model training (simple and effective)
- How does lightningchart, a high performance chart control, draw maps in 3D?
- make Error: error: cast from ‘int32_t*’ {aka ‘int*’} to ‘int’ loses precision [-fpermissive]
- [Warning] incompatible implicit declaration of built-in function ‘strcat’
- C + + common errors: “error: XXX in namespace ‘STD’ does not name a template type”
- [error record] as compilation error (Android support plugin version is too high | upgrade Android studio to the latest version)
- org.thymeleaf.exceptions.TemplateInputException: Error resolving template [XXX]
- Freemarker Failed at: ${ findObj.applyDateStart? string(“yyyy-MM… Template
- Ioremap function and iounmap() function
- template with C linkage