Skip to content

Instantly share code, notes, and snippets.

@satipants
Created July 13, 2016 22:04
Show Gist options
  • Save satipants/bc9a42181af0c4ef47c3ffb32eb8dc13 to your computer and use it in GitHub Desktop.
Save satipants/bc9a42181af0c4ef47c3ffb32eb8dc13 to your computer and use it in GitHub Desktop.
#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