sách gpt4 ăn đã đi

凯撒密码 C 语言

In lại Tác giả: Walker 123 更新时间:2023-11-30 17:38:54 29 4
mua khóa gpt4 giày nike

我已经盯着这个问题好几个星期了,但我一无所获!它不起作用,我知道那么多,但我不知道为什么或出了什么问题。我确实知道开发人员针对我突出显示的行吐出了“错误:预期表达式”,但这实际上只是冰山一角。如果有人知道如何修复其中的任何一小部分,我将不胜感激!!!!

好吧,我改变了 i < n 和 >= 就像你惊人的助手建议的那样,它将运行并创建,但仍然有一个小故障导致这些难看的错误:

:( encrypts "a" as "b" using 1 as key
\ expected output, not an exit code of 0
:( encrypts "barfoo" as "yxocll" using 23 as key
\ expected output, not an exit code of 0
:( encrypts "BARFOO" as "EDUIRR" using 3 as key
\ expected output, but not "E\nA\nU\nI\nR\nR\n"
:( encrypts "BaRFoo" as "FeVJss" using 4 as key

Có gợi ý gì không?

#include 
#include
#include
#include
#include

int main(int argc, char *argv[])
{
//Get the key
if (argc != 2 || atoi(argv[1]) < 0)
{
printf("Usage: ./caesar k");
trả về 1;
}

int key = atoi(argv[1]);
string plaintext = GetString();

for (int i = 0, n = strlen(plaintext); i < n; i++)
{
if (plaintext[i] > 'A' && plaintext[i] <= 'Z')
{
plaintext[i] = (plaintext[i] - 'A' + key) % 26 + 'A';
}
}


for (int i = 0, n = strlen(plaintext); i < n; i++)
{
if (plaintext[i] >= 'A' && plaintext[i] >= 'Z')
{
plaintext[i] = (plaintext[i] - 'A' + key) % 26 + 'A';
}
else if (plaintext[i] >= 'a' && plaintext[i] < 'z')
{
plaintext[i] = (plaintext[i] - 'a' + key) % 26 + 'a';
}
khác
{
printf("%c\n", plaintext[i]);
}
}

trả về 0;
}

câu trả lời hay nhất

更改您的以下行

if (plaintext[i] => 'A' && plaintext[i] >= 'Z')

đến

if (plaintext[i] >= 'A' && plaintext[i] >= 'Z')

Bạn nên sử dụng >= thay vì =>

关于凯撒密码 C 语言,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22004892/

29 4 0
Walker 123
Hồ sơ

Tôi là một lập trình viên xuất sắc, rất giỏi!

Nhận phiếu giảm giá taxi Didi miễn phí
Phiếu giảm giá taxi Didi
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress