关于浙江大学acm2001题
各位大神,再帮忙解决一下,我为啥程序运行到一半终止啊#include <vector>
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main(){
fstream cin("aaa.txt");
vector<int> v;
string s1,s2,st;
int n;
cin>>n;
for(int i=0;i<n;i++){
cin>>s1>>s2;
if(s1.size()>s2.size()){
st=s1;
s1=s2;
s2=st;
}
if((s1[0]-'0')+(s2[0]-'0')>9)
v.push_back(((s1[0]-'0')+(s2[0]-'0'))%10);
else
v.push_back((s1[0]-'0')+(s2[0]-'0'));
for(int j=1;j<s1.size();j++){
v[j]=(s1[j]-'0')+(s2[j]-'0')+((s1[j-1]-'0')+(s2[j-1]-'0'))/10;
for(int m=s1.size();m<s2.size();m++)
v[m]=s2[m];
}
vector<int>::iterator it=v.begin();
if(*it==0)
v.erase(it);
for(int k=0;k<v.size();k++)
cout<<v[k]<<endl;
}
return 0;
}