Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <tchar.h>
- #include <vector>
- #include <iostream>
- const int NUMCARS = 8;
- int _tmain(int argc, _TCHAR* argv[])
- {
- int fuel[NUMCARS]={0,2,0,1,1,2,1,0};
- int carPrice[NUMCARS] = {10000, 8500, 22000, 14000, 37000, 18900, 28000, 45000};
- vector<int> itAr(fuel, fuel + sizeof(fuel) / sizeof(int));
- for(auto& element: itAr)
- {
- cout << "Fuel element: " << element << endl;
- }
- itAr.clear();
- itAr.assign(carPrice, carPrice + NUMCARS);
- for(auto& element: itAr)
- {
- cout << "CarPrice element: " << element << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement