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);
- int shift(char c);
- /*---------------------------*/
- int main (int argc, string argv[])
- {
- if (checkArgs (argc, argv[1]))
- {
- string userInput = get_string("plaintext: ");//получаем ввод пользователя
- int inputLength = strlen(userInput);
- int codLen = strlen((argv[1]));
- int i, c;
- for (i = 0; i < inputLength; i++)//пройти все символы из ввода
- {
- }
- }
- else
- {
- printf("Usage: ./vigenere 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;
- }
- /*-------------------------------------*/
- int shift(char c)
- {
- return tolower(c)-97;
- }
- /*---------------------------------------*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement