更新1:
#include <iostream> using namespace std; int main() { int userInput = 0; int totalBugs = 0; for (int x = 1; x <= 7; ++x) { cout << "Enter num bugs for day #<< x <<:" << endl; cin >> userInput; totalBugs += userInput; } cout << "The total number of bugs: " << totalBugs << endl; }
更新2:
What am i doing wrong?? Can somebody write down the correct program :( ?