#include <iostream>using std::cout;using std::endl;#include <cstdlib>using std::rand;using std::srand;#include <ctime>using std::time;#include <iomanip>using std::setw;int main(){ int a[6][7]; srand(time(0)); for(int i = 0; i < 6; i++) { for(int j = 0; j < 7; j++) { a[i][j] = rand() % 17 - 4; cout << setw(2) << a[i][j] << ' '; } cout << endl; } cout << endl; for(int i = 1; i < 6; i += 2) { for(int j = 0; j < 7; j++) { a[i][j] = 1; } } for(int i = 0; i < 6; i++) { for(int j = 0; j < 7; j++) { cout << setw(2) << a[i][j] << ' '; } cout << endl; } cout << endl; return 0;}
#include <iostream>
using std::cout;
using std::endl;
#include <cstdlib>
using std::rand;
using std::srand;
#include <ctime>
using std::time;
#include <iomanip>
using std::setw;
int main()
{
int a[6][7];
srand(time(0));
for(int i = 0; i < 6; i++)
{
for(int j = 0; j < 7; j++)
{
a[i][j] = rand() % 17 - 4;
cout << setw(2) << a[i][j] << ' ';
}
cout << endl;
}
cout << endl;
for(int i = 1; i < 6; i += 2)
{
for(int j = 0; j < 7; j++)
{
a[i][j] = 1;
}
}
for(int i = 0; i < 6; i++)
{
for(int j = 0; j < 7; j++)
{
cout << setw(2) << a[i][j] << ' ';
}
cout << endl;
}
cout << endl;
return 0;
}