the code does all ok at check50, but
encrypts "BaRFoo" as "CaQGon" using "BaZ" as keyword \ expected output, but not "BzREon\n"
Edit: code deleted due to academic honesty
CS50 Stack Exchange is a question and answer site for students of Harvard University's CS50. It only takes a minute to sign up.Sign up to join this community
Without seeing the rest of your code, I can only take a guess as to what your issue may be.
I believe that since you are not updating the user's input in real-time nor storing the value of keynum, your program takes the single value stored in keynum and cyphers the user's input (keyword) with it. If you run through keynum and the user's input, adding the ith place of keynum to the ith place of the keyword, only one letter will be changed.
Two other things I noticed; first, check out the values your are subtracting from keyword[k]. If I cypher something with the letter a, I am looking to keep the original letter the same, not alter it. Second, you are going to want something in your code that skips over spaces and other non-alpha characters.