#include<iostream> #include<vector> using namespace std; int main(){ vector<int> a; string m; int n; cin>>m>>n; for(int i=m.size()-1;i>=0;i--){ a.push_back(m[i]-'0'); } vector<int> c; int sum=0; for(int i=0;i<a.size()||n||sum;i++){ if(i>=a.size()){ a[i]=0; } sum+=a[i]+n%10; c.push_back(sum%10); sum/=10; n/=10; } while(c.size()>1&&c.back()==0){ c.pop_back(); } for(int i=c.size()-1;i>=0;i--){ cout<<c[i]; } return 0; }
标签:10,高精度,int,sum,back,include,精度,size From: https://www.cnblogs.com/wangyueshuo/p/18225971