python大佬求助!全部RE!

P1601 A+B Problem(高精)

@[lby_commandBlock](/user/791222) 数据末尾可能有空格,因为改成: ```python3 a = list(map(int, list(input().strip())))[::-1] b = list(map(int, list(input().strip())))[::-1] ``` 就可以正常运行了
by iterator_traits @ 2023-01-10 20:30:09


但是友情提示一下您这样改一下之后还不能AC
by iterator_traits @ 2023-01-10 20:30:28


```python a=eval(input()) b=eval(input()) print(a+b) ```
by huangqihao1 @ 2023-01-21 09:51:20


这样就行了,AC
by huangqihao1 @ 2023-01-21 09:52:29


@[huangqihao1](/user/847093) **你们别说可以直接算 a+b**。现在最重要的是要找问题。
by lby_commandBlock @ 2023-01-23 22:53:55


c++: ``` #include<bits/stdc++.h> using namespace std; int main(){ string a,b,res=""; cin>>a>>b; int la=a.size(),lb=b.size(); int d; for(int i=1;i<=max(la,lb);++i){ int s=(la<i?0:(a[la-i]-'0'))+(lb<i?0:(b[lb-i]-'0')+d); d=s/10; s%=10; res=char(s+'0')+res; } if(d!=0){ res=char(d+'0')+res; } cout<<res; return 0; } ``` python代码 ``` a=int(input()) b=int(input()) print(a+b) ``` 所以……
by Jayant_xincheng @ 2023-05-30 20:06:59


|