// Splitter.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "stdlib.h"
#include "stdio.h"


int main(int argc, char* argv[])
{
	if (argc != 2)
	{
		printf("\nUSAGE: splitter 256 <invoer >uitvoer");
		return -1;
	}

	int i = 0;
	int ch;
	int linelen = atoi(argv[1]);

    while ((ch = getchar()) != EOF)
    {
 	   if (i >= linelen)
	   {
			putchar('\n');
			i = 1;
	   }
	   else
		   i++;

	 putchar(ch);
    }
	return 0;
}
