Guest User

Untitled

a guest
Dec 16th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 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. {
  10. if (argc != 2)
  11. {
  12. printf("Usage: ./caesar key\n");
  13.  
  14. }
  15.  
  16. else
  17. {
  18.  
  19.  
  20.  
  21. for (int j = 0, n = strlen(argv[1]); j < n; j++)
  22. {
  23.  
  24. if( !isdigit(argv[1][j]))
  25. {
  26.  
  27.  
  28. printf("Usage: ./caesarkey\n");
  29.  
  30. return 1;
  31.  
  32. }
  33.  
  34.  
  35. }
  36. int k = atoi(argv[1]);
  37. printf( "Success\n");
  38. printf("%i\n", k);
Advertisement
Add Comment
Please, Sign In to add comment