Haval1

Question 2

Jan 19th, 2019
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include"stdafx.h"
  2. #include <iostream>
  3. /*
  4. you have a vector of size a[8] make the value of item 4 a power for all item and saize it in other new vector
  5. */
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.     int i, a[8], b[8];
  11.     for (size_t i = 0; i < 8; i++)
  12.     {
  13.         cin >> a[i];
  14.     }
  15.     for (size_t i = 0; i < 8; i++)
  16.     {
  17.         b[i] = pow(a[i], 4);
  18.     }
  19.     for (size_t i = 0; i < 8; i++)
  20.     {
  21.         cout << b[i] << "  ";
  22.     }
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment