Advertisement
Guest User

Untitled

a guest
May 23rd, 2020
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <ctype.h>
  4. #include <math.h>
  5. #include <cs50.h>
  6. #include <stdlib.h>
  7.  
  8. int main(int argc, string argv[])
  9. {
  10. string p = get_string("plaintext:");
  11. string c[strlen(p)];
  12. int k = atoi(argv[1]);
  13. printf("%i\n", k);
  14.  
  15. if (argc == 2)
  16. {
  17. printf("argc == 2\n");
  18. for (int i = 0, j = strlen(p); i < j; i++)
  19. {
  20. *c[i] = p[i] + k;
  21. }
  22. }
  23. else
  24. {
  25. printf("Enter key please:");
  26. return 1;
  27. }
  28. printf("chiphertext: %s", *c);
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement