w*****j 发帖数: 49 | 1 Hi, every one, I'm a real novice in c++. I'm trying to write a little
programme.
the simplified code is as following:
#include "std_lib_facilities.h"
vector sequence;
void get_sequence(){
int temp;
cout<<"please input the members of the sequence:";
while(cin>>temp){
sequence.push_back(temp);
}
}
void sum_up(){
int n;
cout<<"please indicate how many number you want to sum up:\n";
cin>>n;
}
int main(){
get_sequence();
sum_up();
return 0;
}
when the program |
|