Load a counted dynamic array and reject extra tokens

values.txt starts with n in 0..100 followed by exactly n integers in -1000..1000 and optional trailing whitespace. For this scanf exercise, the count token is representable as size_t and every numeric value token passed to %d is representable as int; arbitrary huge numeric-token parsing is addressed in the capstones. Allocate n ints, check every read and reject any extra non-whitespace character after the required data. Use a separate sum_values function borrowing the array. Print n=k sum=s, or an error and nonzero exit. Show the resource state after opening, after allocating and during a failed third-element read.


