0

我试图了解我为 caesar.c 编程所做的工作,但仍不清楚。至少我想添加 isupper 和 islower 等等?

#include<stdio.h>
#include<cs50.h>
#include<stdlib.h>
#include<string.h>
    #include<ctype.h>

    int main (int argc, string argv[])
    {

    int k;
    k =  atoi(argv[1]);

    if(k <=0)
    {
       printf("You must input a non-negative integer.\n");
       return 1;
    }

    printf("What do you want to cipher?\n");
    string cipherInput = GetString();

    if(isalpha(cipherInput))
    {
    for (int i =0, n = strlen(cipherInput); i < n; i++)
    {
             printf("%c", (cipherInput[i] + k % 26));
    }
    }
    else
    {
       printf("%s\n", cipherInput);
     }

     printf("\n");
}                

我想在编译后有一个结果一定要喝你的阿华田!

即使是 rot 13 也很难理解,但我还没有任何结果。

请给我任何建议。

先感谢您。

4

1 回答 1

0

意外地我得到了这个。

V qvq abg hfr netp gb fbyir guvf ceboyrz。斯特伦(42)

在这一点上,我没有使用 agrc,但仍然对是否可以使用 agrc[] 制作它感兴趣

于 2015-08-16T01:27:19.443 回答