哪里有问题啊QWQ

P1914 小书童——凯撒密码

Atwi_llljx @ 2022-12-26 21:27:45

用C++模仿题解一楼的解法,为什么运行答案都是错的:< 代码长这样↓

#include<bits/stdc++.h>
using namespace std;
string s;
int a;
int main(){
    cin>>a>>s;
    for(int i=0;i<s.length();s[i++]=(s[i]-'a'+a)%26+'a');           
    cout<<s;
}

by Joker_lazydoghead @ 2022-12-26 21:40:19

没错啊


by Joker_lazydoghead @ 2022-12-26 21:40:37

我交了是对的啊


by Gunpowder_OI @ 2022-12-26 21:40:46

这个可能是c++不同版本个性问题,i++或者++i最好还是单独用吧()


by tbdsh @ 2022-12-26 21:41:01

?能 AC

记录


by Joker_lazydoghead @ 2022-12-26 21:41:03

https://www.luogu.com.cn/record/98071990


by Gunpowder_OI @ 2022-12-26 21:41:05

@Gunpowder_OI 特性


by Atwi_llljx @ 2022-12-26 21:43:33

编译器里不行但是洛谷里AC了诶 可能是编译器的问题 谢谢大佬们:>


|