/* catt.c */

#include <stdio.h>

int main(int argc, char *argv[])
{
  FILE *syote;
  int i, c;

  for(i = 0; i < argc; i++) {

	  if (i) {
		  syote = fopen(argv[i], "r");
		  if (! syote)
			  fprintf(stderr, "%s: cannot open %s\n",
					  argv[0], argv[i]);
	  }

	  else if (argc == 1)
		  syote = stdin;

	  else
		  syote = NULL;

	  if (syote) {
		  while ((c = fgetc(syote)) != EOF)
			  putchar(c);
		  fclose(syote);
	  }
  }

  exit(0);

}
