Untitled
unknown
c_cpp
8 months ago
551 B
2
Indexable
Never
#include <iostream> using namespace std; void sum(int m[], int k[], int res[]) { for (int i = 0; i < 20; i++) { res[i] = m[i] + k[i]; } } int asd(int m[], const int size) { for (int i = 0; i < size; i++) { m[i] = rand() % (20 - 5 + 1) + 5; } return 0; } int main() { srand(time(0)); const int n = 20; int mas[n],mas1[n], res[n]; asd(mas, 20); asd(mas1, 20); sum(mas, mas1, res); for (int i = 0; i < 20; i++) { cout << mas[i] << endl; cout << mas1[i] << endl; cout << res[i] << endl << endl; } }
Leave a Comment