3,4 wa

P1601 A+B Problem(高精)

这封装也太恐怖了
by wangziwenhk @ 2023-11-26 11:18:00


超。
by iakmyself @ 2023-11-26 11:37:15


超 ```cpp #include <bits/stdc++.h> using namespace std; int a[510],b[510],c[550]; int main() { string s; string z; cin>>s; for(int i=0;i<s.length();i++) a[i]=s[s.length()-i-1]-'0'; cin>>z; for(int i=0;i<z.length();i++) b[i]=z[z.length()-i-1]-'0'; int p=0,x=0; while(p<s.length()+z.length()) { c[p]=a[p]+b[p]+x; x=c[p]/10; c[p]%=10; p++; } p++; while(c[p]==0&&p>0) p--; for(int i=p;i>=0;i--){ cout<<c[i]; } return 0; } ``` 几行搞定怎么这么复杂(666)
by sjx666_csgo @ 2023-11-26 15:12:23


@[sjx666_csgo](/user/1027657) 为了方便
by yyjw14 @ 2023-11-26 16:02:09


|