Advertisement
ostyleo

Untitled

Nov 30th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.29 KB | None | 0 0
  1.  
  2. V1 = randi([2 7],1,5);
  3. V2 = randi([3 6],1,5);
  4. V3 = randi([5 10],1,5);
  5. V4 = randi([4 10],1,5);
  6. V5 = randi([2 8],1,5);
  7.  
  8. VV = V1 + V2 + V3 + V4 + V5
  9. i = 1;
  10. sum = 0;
  11. while i < 5,
  12.     if VV(i) > 35,
  13.        break
  14.     else
  15.        sum = sum + VV(i);
  16.     end
  17.     i = i + 1;
  18. end
  19. sum
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement