when is sum = 0?


Submit solution

Points: 50 (partial)
Time limit: 1.0s
Memory limit: 256M

Authors:
Problem types

題目說明

請輸入一連串整數,當加總=0時結束輸入,之後輸出總共幾個整數

輸入限制: 數字

輸入

一連串整數

輸出

總共輸入幾個

sample input1

-1 0 2 -1

sample output1

4
//因在輸入第四個整數時加總= 0 (-1 + 0 + 2 + -1 = 0),所以結束輸入

sample input2

0

sample output2

1

Comments

There are no comments at the moment.