Guest User

Untitled

a guest
Dec 16th, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <cs50.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. printf("Usage: ./caesar key\n");
  12.  
  13. }
  14.  
  15. else
  16. {
  17.  
  18.  
  19.  
  20. for (int j = 0, n = strlen(argv[1]); j < n; j++)
  21. {
  22.  
  23. if(isdigit(argv[1][j]))
  24. {
  25.  
  26.  
  27. printf("%c\n", argv[1][j]);
  28.  
  29.  
  30.  
  31. }
  32.  
  33.  
  34. else
  35. {
  36. printf("Usage: ./caesarkey\n");
  37. return 1;
  38.  
  39. }
  40. }
  41.  
  42. }
  43.  
  44.  
  45.  
  46. }
Advertisement
Add Comment
Please, Sign In to add comment