Главная » 2016 » Март » 1 » M6 3
09:23
M6 3

#include <iostream>
#include <ctime>
using namespace std;
int main()
{
    setlocale(LC_ALL,"rus_rus.1251");
    srand(time(0));
    const int n=7;
    const int m=10;
    double a[n][m];

    //матрица
    for (int i=0;i<n;i++)
    {
        for(int j=0;j<m;j++)
        {
           a[i][j]=i+2*j;
        }
    }

    //вывод матрицы
    
    cout.setf(ios::fixed);
    cout.width(7);
    cout.precision(3); 
    cout<<"Матрица A:"<<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;
}

Просмотров: 320 | Добавил: denjes | Рейтинг: 0.0/0
Всего комментариев: 0
avatar