Created
July 13, 2016 22:04
-
-
Save satipants/bc9a42181af0c4ef47c3ffb32eb8dc13 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <cs50.h> | |
#include <ctype.h> | |
#include <string.h> | |
#include <stdlib.h> | |
int main(int argc, string argv[]); | |
int key; | |
int mushmouth; | |
{ | |
string key = argv[1]; | |
if (argc==!6) | |
{ | |
printf("Riddle me thus-wise and you'll have the key: How many geese-a-laying? \n"); | |
return 1; | |
} | |
else | |
{ | |
int key = atoi (key) %26 | |
if key == 0 | |
printf("No, no, no, that's not the answer, try again my Chirstmas Carol addict! \n") | |
break | |
} | |
string wordz = GetString(); | |
if wordz = ! NULL | |
{ | |
for int ( i = 0, n = strlen(wordz) i < n; ii) | |
{ | |
int c = 0; | |
if (isupper (wordz[i])) | |
{ | |
c = (((int) wordz[i] - 65 + k) % 26) + 65; | |
printf (%c, (char) c); | |
} | |
else | |
printf (%c, wordz[i]); | |
break | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment