Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <string.h>
- #include <ctype.h>
- #include <math.h>
- #include <cs50.h>
- #include <stdlib.h>
- int main(int argc, string argv[])
- {
- string p = get_string("plaintext:");
- string c[strlen(p)];
- int k = atoi(argv[1]);
- printf("%i\n", k);
- if (argc == 2)
- {
- printf("argc == 2\n");
- for (int i = 0, j = strlen(p); i < j; i++)
- {
- *c[i] = p[i] + k;
- }
- }
- else
- {
- printf("Enter key please:");
- return 1;
- }
- printf("chiphertext: %s", *c);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement