#include#include #include const int Max = 5;int main(int argc, char const *argv[]) { using namespace std; int golf[Max]; int i; for (i = 0; i < Max; i++) { std::cout << "round #" << i+1 << '\n'; while (!(cin >> golf[i])) { cin.clear(); cin.get(); // while (cin.get() != '\n') { // continue; // } std::cout << "please enter a number:" << '\n'; } } double total = 0.0; for (i = 0;i < Max; i++) { total += golf[i]; } std::cout << total << '\n'; return 0;}
int vector_begin(){ vectorwords; string str; cout << "please input you content==>:" << '\n'; while (cin >> str){ words.push_back(str); if (cin.get() == '\n'){ break; } } vector ::iterator iter; for (iter =words.begin(); iter != words.end(); iter++){ cout << *iter << '\n'; } return 0;}int main () {// assign(); vector_begin(); return 0;}