Originally Posted by
matsp
You'd have to show the code to know that. [Obviously not necessarily ALL of the code, but the part that reads data from the input at least, perhaps also the code to set the input up, if you feel that may be part of the puzzle].
--
Mats
Code:
#define MAXBUF 1024
#include <iostream>
#include <cstdlib>
using namespace std;
int main( int argc, char* argv[] ) {
char thisline[MAXBUF];
int i,j,rotaction;
bool dorot5=false;
bool dorot13=false;
if ( argc == 1 ) {
dorot5=true;
dorot13=true;
}
/* evaluate command line parameters here */
if ( dorot5 == false && dorot13 == false ) {
printhelp(); return 0;
}
do {
cin.getline(thisline,MAXBUF);
i = 0;
do {
if ( thisline[i] == NULL ) break;
if ( dorot5 && (int)thisline[i] > 47 && (int)thisline[i] < 53 ) {
j = (int)thisline[i]+5;
cout << (char)j;
i++; continue; };
/* more stanzas like the one above go here */
cout << thisline[i];
i++;
} while ( i < MAXBUF+1 );
cout << endl;
} while ( thisline > "" );
return 0;
}