SHARE
TWEET

Untitled

a guest Oct 21st, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include <Windows.h>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.   setlocale(LC_ALL, "rus");
  8.   int A[5], B[5], C[5];
  9.   cout<<"Введите элементы массива А: "<<endl;
  10.   for(int i=0; i<5; i++){
  11.     cin>>A[i];
  12.   }
  13.   cout<<"Введите элементы массива B: "<<endl;
  14.   for(int i=0; i<5; i++){
  15.     cin>>B[i];
  16.   }
  17.   for(int i=0; i<5; i++){
  18.     cout<<A[i]<<" ";
  19.   }
  20.   cout<<" - Массив А"<<endl;
  21.   for(int i=0; i<5; i++){
  22.     cout<<B[i]<<" ";
  23.   }
  24.   cout<<" - Массив B"<<endl;
  25.   for(int i = 0; i<5; i++){
  26.     if(A[i] == B[i]){
  27.         C[i] = A[i];
  28.     }
  29.     else{
  30.         if(A[i] > B[i]){
  31.             C[i] = A[i];
  32.         }
  33.         else if(A[i] < B[i]){
  34.             C[i] = B[i];
  35.         }
  36.     }
  37.   }
  38.    for(int i=0; i<5; i++){
  39.     cout<<C[i]<<" ";
  40.   }
  41.   cout<<" - Массив C"<<endl;
  42.   system("PAUSE >> null");
  43.   return 0;
  44. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top