Advertisement
Guest User

Untitled

a guest
Apr 16th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. /******************************************************************************
  2.  
  3. Online C++ Compiler.
  4. Code, Compile, Run and Debug C++ program online.
  5. Write your code in this editor and press "Run" button to compile and execute it.
  6.  
  7. *******************************************************************************/
  8.  
  9. #include <iostream>
  10.  
  11. using namespace std;
  12.  
  13. int main()
  14. {
  15. int n=10;
  16. int a[n]={1,-1,5,-5,2,3,4,-23,4,-123};
  17. int b[n]={1,2,3,4,5,6,7,8,9,10};
  18.  
  19. cout << "Результирующий массив b" << endl;
  20. for (int i=0;i<n;i++){
  21. if (a[i]<=0){
  22. b[i]=b[i]*10;
  23. } else{
  24. b[i]=0;
  25. }
  26. cout << b[i] << " ";
  27. }
  28.  
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement