#include<iostream>
using namespace std;
int main(){
int value,sum=0;
while(cin>>value){
sum+=value;
}
cout<<"The sum of the values is "<<sum;
return 0;
}
按非法字符或CTRL+Z+enter中止
#include<iostream>
using namespace std;
int main(){
int value,sum=0;
while(cin>>value){
sum+=value;
}
cout<<"The sum of the values is "<<sum;
return 0;
}
按非法字符或CTRL+Z+enter中止