Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cs50.h>
- #include <stdio.h>
- #include <ctype.h>
- #include <string.h>
- #include <stdlib.h>
- int main(int argc, string argv[])
- {
- if (argc != 2) //if user doesn't run command-line argument of one or enter positive int
- {
- printf("Usage: ./vigenere key\n"); //prompt them to run it again
- return 1; //returning zero means everything went well
- }
- for (int j = 0, n = strlen(argv[j]); j < n; j++) //length of the entire string. Save n as strlen for use in loop
- if (argc == 2 && isalpha(argv[j])) //if user doesn't run command-line argument of one or enter positive int and user inputs an alpha key, continue
- {
- printf("ciphertext: "); //Print after collecting plaintext
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement