1. 先举例:
1 int main() 2 { 3 int sum1 = 0, value; 4 while(cin >> value){ 5 sum1 += value; 6 } 7 cout << sum1 << endl; 8 return 0; 9 }
像这种循环输入求和怎么断掉终端输出sum1?
输入 = 即可