samedi 9 novembre 2019

Scan a number into INT variable until newline

We are doing Caesar cipher, where the first ROW is the number of characters, second one is the encrypted message and the third row is a partially right answer.

The Caesar cipher is completed, but I can only scan stuff from console, not from actual files as of now.

Question is, how do I scan a number until an end of line (newline character), AND, in case the row contains something different than actual integers (4a4, a44, 44a, a), print out an error?

Aucun commentaire:

Enregistrer un commentaire