I asked a question about my code a while back and it still doesn't make sense to me. I tried to look at the answers to my old question but still doesnt make sense. I also tried to fix my curly braces--are they wrong?
#include <stdio.h>
#include <cs50.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
int upper(int input);
int lower(int input);
int main(int argc, string argv[])
{
string k = atoi(argv[1]);
if (argc != 2)
;
int key = argv[1];
printf("The key must be an int. Please try again.");
return 1;
{
else
}
printf("Good, now enter a plaintext!:");
string plain = GetString();
for (int i = 0, n = strlen(plain); i < n; i++)
{
if (isalpha(plain[i]))
{
if (isupper(plain[i]))
{
printf("%c", upper(plain[i]));
}
if (islower(plain[i]));
{
printf("%c", lower(plain[i]));
}
}
else
{
printf("%c" , plain[i]);
}
}
{
int key = argv[1];
int upper(int input);
int i = input - 65 + key;
int k = i + 65;
return k;
int lower(int input);
int i = input - 97 + key;
i = i % 26;
int k = i + 97;
return k;
}
}