求助dalao,为什么__int128全哇

P1601 A+B Problem(高精)

@[chenaihu](/space/show?uid=132953) 没看数据范围吗?
by StudyingFather @ 2018-12-19 20:44:34


@[StudyingFather](/space/show?uid=22030) 他只是试一下
by miaojiexi @ 2018-12-19 20:46:46


@[StudyingFather](/space/show?uid=22030) 此代码有40分: ```cpp #include<bits/stdc++.h> using namespace std; int main() { int a,b; cin>>a>>b; cout<<a+b; return 0; } ``` ### ???
by 初墨 @ 2018-12-20 18:16:41


... #include<bits/stdc++.h> using namespace std; int main(){ char s1[2000],s2[2000]; int a[2000]={0},b[2000]={0}; int c[2000]={0}; int l,m,n=0,i,x=0; scanf("%s",s1); scanf("%s",s2); l=strlen(s1); m=strlen(s2); for(i=0;i<l;i++) a[l-i]=s1[i]-'0'; for(i=0;i<m;i++) b[m-i]=s2[i]-'0'; for(i=0;i<l;i++) if(s1[i]=='0')n++; for(i=0;i<m;i++) if(s2[i]=='0')x++; if(n==l&&x==m)cout<<"0"; n=1; x=0; while(n<=l||n<=m){ c[n]=a[n]+b[n]+x; x=c[n]/10; c[n]%=10; n++; } c[n]=x; while(c[n]==0) n--; for(i=n;i>=1;i--){ cout<<c[i]; } return 0; }
by 退役蒟蒻 @ 2018-12-21 21:09:45


@[NOI大佬](/space/show?uid=59274) 希望更丰富的展现?使用Markdown
by South_Sky_Plume5 @ 2019-03-07 19:38:53


|