Первое задание
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
const int N = 3;
const int M = 4;
int A[N][M];
for(int i = 0; i < N; i++){
for(int j = 0; j < M; j++){
cout << "Element [" << i << "][" << j << "] = "; cin >> A[i][j];
}
cout << "Output mas" << endl;
for(int j = 0 ; j < M; j++){
cout << A[i][j] << " ";
cout << endl;
system("pause");
return 0;
Второе задание
#include <ctime>
srand(time(NULL));
const int N = 50;
int temp;
int A[N];
temp = rand()%100;
while(temp % 2 != 1){
A[i] = temp;
cout << A[i] << endl;
Первое задание
#include <iostream>
#include <cstdlib>
using namespace std;
int main()
{
const int N = 3;
const int M = 4;
int A[N][M];
for(int i = 0; i < N; i++){
for(int j = 0; j < M; j++){
cout << "Element [" << i << "][" << j << "] = "; cin >> A[i][j];
}
}
cout << "Output mas" << endl;
for(int i = 0; i < N; i++){
for(int j = 0 ; j < M; j++){
cout << A[i][j] << " ";
}
cout << endl;
}
system("pause");
return 0;
}
Второе задание
#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
int main()
{
srand(time(NULL));
const int N = 50;
int temp;
int A[N];
for(int i = 0; i < N; i++){
temp = rand()%100;
while(temp % 2 != 1){
temp = rand()%100;
}
A[i] = temp;
}
for(int i = 0; i < N; i++){
cout << A[i] << endl;
}
system("pause");
return 0;
}