Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "iostream"
- #include "windows.h"
- using namespace std;
- int main()
- {
- cout<<"Vvedite kolichestvo chisel v massive: ";
- int n;
- cin >> n;
- int *A = new int [n];
- int *B = new int [n];
- int k, l;
- k=0;
- l=0;
- cout<<"\n"<<" Vvedite pervii massiv: ";
- for (int i = 0; i < n; i++)
- {
- cin >> A[i];
- if (A[i] < 0)
- k++;
- }
- cout<<"\n"<<" Vvedite vtoroi massiv: ";
- for (int i = 0; i < n; i++)
- {
- cin >> B[i];
- if (B[i] < 0)
- l++;
- }
- if ((l = k) && (l != 0))
- {
- cout << "Kolichestvo otricatelnih chisel ravno";
- system("pause");
- return 0;
- }
- if ((k=0) && (l = 0))
- {
- cout << "Otricatelnii chisla otsutstvuyt";
- system("pause");
- return 0;
- }
- if(l > k)
- {
- for (int i = 0; i < n; i++)
- {
- cout << B[i]<< " ";
- }
- cout << "\n";
- for (int i = 0; i < n; i++)
- {
- cout << A[i] << " ";
- }
- system("pause");
- return 0;
- }
- else {
- for (int i = 0; i < n; i++)
- cout << A[i];
- cout << "\n";
- for (int i = 0; i < n; i++)
- cout << B[i] << " ";
- system("pause");
- return 0;
- }
- if ((l = k) && (l != 0)) cout << "Kolichestvo otricatelnih chisel ravno";
- if ((l = k) && (l = 0)) cout << "Otricatelnii chisla otsutstvuyt";
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement