/* * Solution Template for Sitting or Standing? * * 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 r; int s; int num_tickets; int num_sitting; int num_standing; int main(void) { /* Open the input and output files. */ FILE *input_file = fopen("sitin.txt", "r"); FILE *output_file = fopen("sitout.txt", "w"); /* Read the values from the input file. */ fscanf(input_file, "%d%d", &r, &s); fscanf(input_file, "%d", &num_tickets); /* * TODO: This is where you should compute the answers and store them into * the variables num_sitting and num_standing. */ /* Write the answer to the output file. */ fprintf(output_file, "%d %d\n", num_sitting, num_standing); /* Finally, close the input/output files. */ fclose(input_file); fclose(output_file); return 0; }