坑啊

P1601 A+B Problem(高精)

换不换行哪有两样.....你下测试点试试呗
by 初音Miku @ 2018-07-15 11:17:14


这题数据有问题吧,我试了测试数据, 第一个是123,123 我输出246为什么WA啊?
by 无声告白 @ 2018-07-15 11:17:28


```cpp #include<iostream> #include<cstring> #include<bits/stdc++.h> using namespace std; int a[100],b[100],c[100],lena,lenb,lenc,i,x; char a1[100],b1[100]; int main() { gets(a1); gets(b1); lena=strlen(a1); lenb=strlen(b1); for(i=0; i<lena; i++) a[lena-i]=a1[i]-48; for(i=0; i<lenb; i++) b[lenb-i]=b1[i]-48; lenc=1; x=0; while(lenc<=lena||lenc<=lenb) { c[lenc]=a[lenc]+b[lenc]+x; x=c[lenc]/10; c[lenc]%=10; lenc++; } c[lenc]=x; if(c[lenc]==0) lenc--; for(i=lenc; i>=1; i--) cout<<c[i]; return 0; } ``` 有毒的题
by 无声告白 @ 2018-07-15 11:18:38


@[汤畅](/space/show?uid=95050) 当然能换行
by andyli @ 2018-07-15 11:21:31


换了也是错,不还也是错
by 无声告白 @ 2018-07-15 11:26:42



by 无声告白 @ 2018-07-15 11:26:53


您数组开小了吧..
by _ConveX @ 2018-07-15 11:36:18


不能用gets啊.........怎么老是有人傻乎乎的用啊
by WSEDSWZD @ 2018-07-15 11:40:55


另外数组的确开小了
by WSEDSWZD @ 2018-07-15 11:41:30


@[汤畅](/space/show?uid=95050) 是gets以及数组开小的问题,别动不动就说是数据的问题,你看看有多少人通过?
by 1124828077ccj @ 2018-07-15 11:43:53


| 下一页