/* * Solution Template for A Mindbending Scenario * * This file is provided to assist with reading and writing of the input * files for the problem. You may modify this file however you wish, or * you may choose not to use this file at all. */ #include int r1_x1; int r1_y1; int r1_x2; int r1_y2; int r2_x1; int r2_y1; int r2_x2; int r2_y2; int answer; int main(void) { /* Open the input and output files. */ FILE *input_file = fopen("bendin.txt", "r"); FILE *output_file = fopen("bendout.txt", "w"); /* Read the values from the input file. */ fscanf(input_file, "%d%d%d%d", &r1_x1, &r1_y1, &r1_x2, &r1_y2); fscanf(input_file, "%d%d%d%d", &r2_x1, &r2_y1, &r2_x2, &r2_y2); /* * TODO: This is where you should compute the answer and store it into the * variable answer. */ /* Write the answer to the output file. */ fprintf(output_file, "%d\n", answer); /* Finally, close the input/output files. */ fclose(input_file); fclose(output_file); return 0; }