4 1 2 3 4 5 1 2 3 4 5 0
10 15
![None.gif](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
2
![None.gif](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
3
![None.gif](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
4
![ExpandedBlockStart.gif](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
![ContractedBlock.gif](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
![dot.gif](https://www.cnblogs.com/Images/dot.gif)
5
![InBlock.gif](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
6
![InBlock.gif](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
7
![InBlock.gif](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
8
![ExpandedSubBlockStart.gif](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![ContractedSubBlock.gif](https://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif)
![dot.gif](https://www.cnblogs.com/Images/dot.gif)
9
![InBlock.gif](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
10
![InBlock.gif](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
11
![ExpandedSubBlockStart.gif](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockStart.gif)
![ContractedSubBlock.gif](https://www.cnblogs.com/Images/OutliningIndicators/ContractedSubBlock.gif)
![dot.gif](https://www.cnblogs.com/Images/dot.gif)
12
![InBlock.gif](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
13
![InBlock.gif](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
14
![ExpandedSubBlockEnd.gif](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
15
![InBlock.gif](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
16
![InBlock.gif](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
17
![ExpandedSubBlockEnd.gif](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedSubBlockEnd.gif)
18
![ExpandedBlockEnd.gif](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif)
Summary:
The iostream system is always a puzzling part for any programming language, so is C's.
1. DO NOT forget to initialize the value of b to ZERO in the beginning of each loop.
2. The scanf function ignores any whitespace character(blank, newline or tab) and make them the seperator for each next non-whitespace character that will be read. So either the "\n" or "space" can be treat as the terminal condition. I DID NOT use the number of addends as the condition(first number) as it's read by line 10.
3. Let's look into the whole process in detail.
Line 5, initialize each variable. As a will be used as the terminal condition, it's put to be 1.
Line 7, when the first value of each input loop gets 0, the whole process ends.
Line 9, initialize the value of b to ZERO in the beginning of each loop.
Then come to the next block. Suppose the input is 4 1 2 3 4. Line 10 reads each space character until the '\n' and line 12 retrieves the value of numbers.
Line 16, IMPORTANT, read the first value of the next new input loop to make it as the validation condition for line 7.
I had submitted the codes for several times before accepted.
184988_0_12269.c: In function `main':
184988_0_12269.c:14: error: syntax error before '/' token
Remember, the Online Judge Compiler seems not to support any referance with //.