#include #include #include #include #include #include const int A = 26; int main(int argc, string argv[]) { //checking if one command-line argument is given if (argc != 2) { printf("Usage: ./caesar key\n"); return 1; } else { //testing if key consists of proper positive integers for (int i = 0, n = strlen(argv[1]); i < n ;i++) { if (isdigit(argv[1][i]) == 0) { return 1; } } } string message = get_string("plaintext: "); int key = atoi(argv[1]); printf("ciphertext: "); for (int i = 0, n = strlen(message); i < n; i++) { string c; printf("%c", message[i] + key); } printf("\n"); }