I have received cipher documents which are believed to be secret messages. So, my mission is to break the encoding and reveal what the secrets are that each file contains. However,it is believed that each file contains a message protected with a "null cipher" which surround the real characters in messages with one or more "null" characters. So, to reveal the message, I have to read in each character in the file, but only print out every other, or every third, or every fourth character.
I already built my project and it debugged successful. However, I can't decode the secret and I stuck right here. I am confusing and wondering that I have built it correctly or not. So please take a look over my project and give me your opinion. Thanks.
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iomanip>
using namespace std;
int main(int argc, char * argv[])
{
int c, count = atoi(argv[1]);
srand(time(NULL));
c = rand();
char b;
do
{
for (int i = 1; i < count; i++)
c = cin.get();
c = cin.get();
c = cin.get();
cout.put(c);
}while(!cin.eof());
}