麻烦各位大佬帮忙看看哪里错了

P1597 语句解析

@[yuyuyuyu12345](/user/324176) ```c++ else b[k++]='0'; ``` 为什么要赋 $0$ 呢
by ImposterAnYu @ 2022-10-20 17:12:11


@[owo_ImposterAnYu_owo](/user/510555) 那个输入没赋值的时候不是0嘛,然后我就赋值0啦
by yuyuyuyu12345 @ 2022-10-20 17:38:07


@[yuyuyuyu12345](/user/324176) 然而它赋的值可能是个变量诶
by ImposterAnYu @ 2022-10-20 17:40:13


@[yuyuyuyu12345](/user/324176) 喔~谢谢大佬
by yuyuyuyu12345 @ 2022-10-20 17:43:11


@[owo_ImposterAnYu_owo](/user/510555) 明白啦,谢谢谢
by yuyuyuyu12345 @ 2022-10-20 17:43:32


```cpp #include<bits/stdc++.h> using namespace std; int r1=1,r2=1;string a; int x,y,z,la; int main() { cin>>a;la=a.size()-1;x=y=z=0; for(int i=0;i<=la;i++) { if(i%5==0) { if(a[i]=='a') { if(a[i+3]=='b') { x=y; } else if(a[3+i]=='c') { x=z; } else if(a[3+i]=='a') { } else { x=int(a[i+3]-48); } } if(a[i]=='b') { if(a[i+3]=='a') { y=x; } else if(a[3+i]=='c') { y=z; } else if(a[3+i]=='b') { } else { y=int(a[i+3]-48); } } if(a[i]=='c') { if(a[i+3]=='b') { z=y; } else if(a[3+i]=='c') { } else if(a[3+i]=='a') { z=x; } else { z=int(a[i+3]-48); } } } } printf("%d %d %d",x,y,z); return 0; }
by xingcode @ 2022-11-27 15:10:44


|