Advertisement
jaVer404

vigenere_01

Apr 24th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.89 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <cs50.h>
  3. #include <string.h>
  4. #include <ctype.h>
  5.  
  6. /*----function declaration-*/
  7. bool checkArgs (int num, string input);
  8. string codeWord(int key, string userInput);
  9. /*---------------------------*/
  10.  
  11. int main (int argc, string argv[])
  12. {
  13.     if (checkArgs (argc, argv[1]))
  14.     {      
  15.         string userInput = get_string("plaintext:  ");//получаем ввод пользователя
  16.         int inputLength = strlen(userInput);
  17.     }
  18.     else
  19.     {
  20.         printf("invalid keyword\n");
  21.         return 1;
  22.     }
  23. }
  24.  
  25.  
  26.  
  27. bool checkArgs (int num, string input)
  28. {
  29.     if (num != 2)
  30.     {
  31.         return false;
  32.     }
  33.     int i, f;
  34.     for (i = 0, f = strlen(input); i < f; i++)
  35.     {
  36.         if (isalpha(input[i]))
  37.         {
  38.             //nothing
  39.         }
  40.         else
  41.         {
  42.             return false;
  43.         }
  44.     }
  45.     return true;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement