ToniDev

Stiva C++

Apr 7th, 2022
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include <iostream>  //input - output stream
  2. using namespace std;
  3.  
  4. struct Stiva {
  5.     int vector[5];
  6.     int varf;
  7. };
  8.  
  9. int main(){
  10.  
  11.     Stiva st;
  12.  
  13.     st.vector[0] = 2;
  14.     st.varf = st.vector[0];
  15.     cout << st.varf;
  16.  
  17.     st.vector[1] = 3;
  18.     st.varf = st.vector[1];
  19.     cout << st.varf;
  20.  
  21.     st.vector[2] = 4;
  22.     st.varf = st.vector[2];
  23.     cout << st.varf;
  24.  
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment