有人知道A3的in和out吗?

P1914 小书童——凯撒密码

Liuxizai @ 2020-08-12 20:31:45

找不到代码哪里有问题


by Jasonying @ 2020-08-12 20:34:46

代码发出来康康


by DYH060310 @ 2020-08-12 20:35:19

code?


by Jasonying @ 2020-08-12 20:38:33

好了,lz的代码:

#include<bits/stdc++.h>
using namespace std;
int main(){
    string password;
    int n;
    cin >> n >> password;
    for(int i = 0; i < password.size(); i++){
        for(int j = 0; j < n; j++){
            password[i]++;
            if(password[i] > 'z') password[i] == 'a';
        }
    }
    cout << password;
    return 0;
}

by Spasmodic @ 2020-08-12 20:39:58

if(password[i] > 'z') password[i] == 'a';

->

if(password[i] > 'z') password[i] = 'a';

by Spasmodic @ 2020-08-12 20:40:07

@Liuxizai


by Jasonying @ 2020-08-12 20:41:45

我就说这句怎么看起来这么奇怪


by Liuxizai @ 2020-08-12 20:46:41

已经改了,我nt


by Reliauk @ 2020-08-12 20:54:03

我看了三遍才看出来哪改了没救了


by Implicit @ 2020-08-12 21:19:17

@Rir5 ++


|