Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdlib.h>
- using namespace std;
- int main()
- {
- int a[10];
- int c[10];
- cout << "Массив A: ";
- for (int i = 0; i < 10; i++) {
- a[i] = rand() % 10 - 5;
- cout << a[i] << ' ';
- }
- cout << "\nМассив Ak: ";
- for (int i = 0; i < 10; i++) {
- c[i] = rand() % 10 - 5;
- cout << c[i] << ' ';
- }
- cout << "\nЭлементы в промежутке от 1 до 10: ";
- int b = -1;
- for (int i = 0; i < 10; i++) {
- if (c[i] > a[0] && c[i] < a[9]) {
- cout << c[i] << ' ';
- b = a[i];
- }
- }
- if (b == -1) cout << 0;
- cout << '\n';
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement