Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
621 B
1
Indexable
Never
#include <iostream>
using namespace std;
void fill(int mas[],int nas[], const int size, int a, int b)
{
	for (int i = 0; i < size; i++) {
		mas[i] = rand() % (b - a + 1) + a;
		nas[i] = rand() % (b - a + 1) + a;
	}
}
void summ(int mas[], int nas[], int ans[], const int size)
{

	for (int i = 0; i < size; i++) {
		ans[i] = mas[i] + nas[i];
	}
}
int main()
{
	srand(time(0));
	const int size = 100;
	int n,a,b;
	cin >> n;
	cin >> a >> b;
	int mas[size], nas[size],mnas[size];
	fill(mas, nas, n, a, b);
	summ(mas, nas, mnas, n);
	for (int i = 0; i < size; i++) {
		cout << mnas[i] << " ";
	}
}
Leave a Comment