// 
// removebrackets.c
//
// Removes any '[' or ']' characters from an input stream.
//
#include <stdio.h>
#include <stdlib.h>

int main( int argc, char **argv )
     {
     int ch;
     int whitecount = 0;
     int skips = 0;

     if( argc == 2 )
          skips = atoi( argv[ 1 ] );

     ch = getchar();
     while( ch != EOF )
          {
          if(( ch != '[' ) && ( ch != ']' ))
               {
               if( whitecount >= skips )
                    putchar( ch );
               else if( ch == ' ' )
                    whitecount++;
               }
          ch = getchar();
          }
     return( 0 );
     }

// End of File


