'was not declared in this scope' error

前端 未结 5 738
难免孤独
难免孤独 2020-12-01 15:55

So I was writing this simple program to calculate the day of any date using the Gaussian algorithm found here.

#include 
using namespace std;         


        
5条回答
  •  一整个雨季
    2020-12-01 16:15

    #include 
    using namespace std;
    class matrix
    {
        int a[10][10],b[10][10],c[10][10],x,y,i,j;
        public :
            void degerler();
            void ters();
    };
    void matrix::degerler()
    {
        cout << "Satırları giriniz: "; cin >> x;
        cout << "Sütunları giriniz: "; cin >> y;
        cout << "İlk matris elamanlarını giriniz:\n\n";
        for (i=1; i<=x; i++)
        {
            for (j=1; j<=y; j++)
            {
                cin >> a[i][j];
            }
        }
        cout << "İkinci matris elamanlarını giriniz:\n\n";
        for (i=1; i<=x; i++)
        {
            for (j=1; j<=y; j++)
            {
                cin >> b[i][j];
            }
        }
    }
    
    void matrix::ters()
    {
        cout << "matrisin tersi\n";
        for (i=1; i<=x; i++)
        {
            for (j=1; j<=y; j++)
            {
        if(i==j)
        {
        b[i][j]=1;
        }
        else
        b[i][j]=0;
        }
    }
    float d,k;
        for (i=1; i<=x; i++)
        {
        d=a[i][j];
            for (j=1; j<=y; j++)
            {
        a[i][j]=a[i][j]/d;
                b[i][j]=b[i][j]/d;
        }
            for (int h=0; h> secim;
        switch (secim)
        {
            case 1:
                m.ters();
                break;
        }
        cout << "\nBaşka bir şey yap/n?";
        cin >> ch;
        }
        while (ch!= 'n');
        cout << "\n";
        return 0;
    }
    

提交回复
热议问题