Cod sursa(job #2262544)

Utilizator vlad_schillerSchiller Vlad Radu vlad_schiller Data 17 octombrie 2018 16:32:43
Problema Al k-lea termen Fibonacci Scor 0
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 1.37 kb
#include <iostream>
using namespace std;
class matrix
{
private:
    int **a;
    int n,m;
public:
    matrix(int l,int c)
    {
        n=l;
        m=c;
        a= new (int*);
        n;
        for(int i=0; i<n; i++)
            a[i]=new int[m];
    }
    ~matrix()
    {
        for(int i=0; i<n; i++)
            delete a[i];
        delete a;
    }
    void citire()
    {
        cout<<"Introdu elementele lui matricie \n";
        for(int i=0; i<n; i++)
            for(int j=0; j<m; j++)
                cin>>a[i][j];
    }
    void afisare()
    {
        for(int i=0; i<n; i++)
        {
            for(int j=0; j<m; j++)
                cout<<a[i][j]<<" ";
            cout<<"\n";
        }
    }
    matrix& operator+=(matrix &y)
    {
        for(int i=0; i<n; i++)
            for(int j=0; j<m; j++)
                a[i][j]+=y.a[i][j];
        return *this;
    }
    matrix& operator-=(matrix &y)
    {
        for(int i=0; i<n; i++)
            for(int j=0; j<m; j++)
                a[i][j]-=y.a[i][j];
        return *this;
    }
    matrix& operator=(matrix &y)
    {
        for(int i=0; i<n; i++)
            for(int j=0; j<m; j++)
                a[i][j]=y.a[i][j];
            n=y.n;
            m=y.m;
        return *this;
    }
    matrix& operator*=(matirx &y)
};

int main()
{
    cout<<1;
    return 0;
}