Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /******************************************************************************
- Online C++ Compiler.
- Code, Compile, Run and Debug C++ program online.
- Write your code in this editor and press "Run" button to compile and execute it.
- *******************************************************************************/
- #include <iostream>
- using namespace std;
- int main()
- {
- int n=10;
- int a[n]={1,-1,5,-5,2,3,4,-23,4,-123};
- int b[n]={1,2,3,4,5,6,7,8,9,10};
- cout << "Результирующий массив b" << endl;
- for (int i=0;i<n;i++){
- if (a[i]<=0){
- b[i]=b[i]*10;
- } else{
- b[i]=0;
- }
- cout << b[i] << " ";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement