|
|
|
|
|
|
|
|
There are 10 test files with different inputs |
the amount of weeks are based on the user's input |
|
|
3 0 1 2 3 4 5 6 0 0 0 0 0 0 1 1 1 1 1 1 1 1 |
21 1 7 |
|
|
it's like there's a user, who tries your program 10 times, but it's actually an online test system that tests your code with different pre-written values every single times, and therefore the output and input will change all the time. You can't see the test files, all you know is that the test files are correct (no negative values, no letters if you have to use numbers, etc.) |
|
|
Yes, this is good, but I need to show the output only after the entire array is filled with the numbers, not after each lines. |
"Please enter the number of weeks"
and the user input would appear interspersed with the output. In that case, you could use a simple 1D array int total[1000];
so instead of outputting the total as it is calculated, instead store it in the array. Then afterwards, output the contents of the total array.
|
|
|
|
|
|
all I want to understand is this sum thing |
but I didn't really have any idea how to work with N amount of lines. |
|
|
|
|