Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <cs50.h>
- #include <string.h>
- #include <ctype.h>
- /*----function declaration-*/
- bool checkArgs (int num, string input);
- string codeWord(int key, string userInput);
- /*---------------------------*/
- int main (int argc, string argv[])
- {
- if (checkArgs (argc, argv[1]))
- {
- string userInput = get_string("plaintext: ");//получаем ввод пользователя
- int inputLength = strlen(userInput);
- }
- else
- {
- printf("invalid keyword\n");
- return 1;
- }
- }
- bool checkArgs (int num, string input)
- {
- if (num != 2)
- {
- return false;
- }
- int i, f;
- for (i = 0, f = strlen(input); i < f; i++)
- {
- if (isalpha(input[i]))
- {
- //nothing
- }
- else
- {
- return false;
- }
- }
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement