Advertisement
Guest User

Untitled

a guest
Dec 14th, 2019
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #include <cs50.h>
  2. #include <stdio.h>
  3. #include <string.h>
  4. #include <ctype.h>
  5.  
  6.  
  7. int main(int argc, string argv[1])
  8. {
  9. if (argc == 2)
  10. {
  11.  
  12. for (int j = 0, n = strlen(argv[1]); j < n ; j++)
  13. {
  14.  
  15.  
  16. if (isdigit(argv[1][j]))
  17. {
  18.  
  19. printf("%c", (argv[1][j]));
  20.  
  21. }
  22.  
  23. }
  24. printf ("\n");
  25. printf("Success\n");
  26. }
  27.  
  28.  
  29. else
  30. {
  31. printf("Usage: ./caesar key\n");
  32.  
  33. return 1;
  34.  
  35. }
  36.  
  37.  
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement