Here is a part of my caesar code. I used Check50 to check it, but got a bunch of results saying that it expected an input, not an output for the answer. However, when I manually typed in the answers, all of the answers worked.
thx in advance
> #include <stdio.h>
#include <cs50.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
int main(int argc, string argv[])
{
int Input = atoi(argv[1]);
int NewNumber;
{
printf ("Type in your text here: ");
string text = GetString();
for (int i = 0, length = strlen(text); i < length; i++)
{
char Letter = text[i];
if (isupper(Letter))
{
int Convert = (int)Letter - 65;
NewNumber = Convert + Input;
NewNumber = NewNumber%26 + 65;
}
else if (islower(Letter))
{
int Convert = (int)Letter - 97;
NewNumber = Convert + Input;
NewNumber = NewNumber%26 + 97;
}
else
{
NewNumber = (int)Letter;
}
char NewText = (char)NewNumber;
printf ("%c", NewText);
}
printf ("\n");
return 0;
}
}