Question
Integers numEmployees, firstEmployee, middleEmployee, and lastEmployee are read from input. First, declare a vector of integers named runningNumbers with a size of numEmployees. Then, initialize
Integers numEmployees, firstEmployee, middleEmployee, and lastEmployee are read from input. First, declare a vector of integers named runningNumbers with a size of numEmployees. Then, initialize the first, middle, and last element in runningNumbers to firstEmployee, middleEmployee, and lastEmployee, respectively.
Ex: If the input is 10 186 173 180, then the output is:
186 0 0 0 0 173 0 0 0 180
#include
int main() { int numEmployees; int firstEmployee; int middleEmployee; int lastEmployee; unsigned int i;
cin >> numEmployees; cin >> firstEmployee; cin >> middleEmployee; cin >> lastEmployee;
/* Your code goes here */
for (i = 0; i < runningNumbers.size(); ++i) { cout << runningNumbers.at(i) << " "; } cout << endl;
return 0; }
C++ please
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started