#include <iostream>
using namespace std;
 
const int M = 3;
const int N = 3;
typedef double T;
T a [M][N], b [M][N], c[M][N];
 
void zero(T x[M][N])
{
    for (int i = 0; i < M; i++)
    {
        for (int k = 0; k < N; k++)
        {
            a[i][k] = 0;
        }
    }
}
void one(T x[M][N])
{
    zero(x);
    for (int i = 0; i < M; i++)
    {
        x[i][i] = 1;
    }
}
void print(string name, T x [M][N])
{
    cout << name << " [ " << endl;
    for (int i = 0; i < M; i++)  // cyklus pro radky
    {
        cout << "   ( ";
        for (int k = 0; k < N; k++)  // cyklus pro sloupce
        {
            cout << x[i][k];
            if (k < N - 1) cout << ", ";
        }
        cout << " )" << endl;
    }
    cout << "]" << endl;
}
 
int main()
{
    zero(a);
    one(b);
    print("acko", a);
    print("becko", b);
    cout << "O.K.";
}
 
pole2019c.txt · Last modified: 2019/10/10 15:02 by 147.32.8.115
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki