#include <stdio.h>
int main(int argc, char * argv[])
{
  FILE * fp;
  int i,j;
  if (argc < 1) {
     if (fprintf(stderr,
                 "no file name!\n") < 0) {
         exit(3);
     }
     exit(2);
  }
  fp = fopen(argv[1], "r");
  if (fp == NULL) {
      perror("can't read file!\n");
      exit(4);
  }
  if (fscanf(fp, "%d %d", &i, &j) != 2) {
      perror("bad format file!\n");
      exit(5);
  }
  if (printf("%d\n", i+j) < 0) {
      perror("can't do output!\n");
      exit(6);
  }
  if (fclose(fp) == EOF) {
      perror("can't close file!\n");
      exit(7);
  }
  return(0);
}
