Я искал по всему интернету, но нигде не могу найти ответ на свою проблему. Я пытаюсь написать программу, которая найдет обратную матрицу 3х3, и пытаюсь настроить матрицу несовершеннолетних.
Код (это не весь код, а только часть, которая не работает):
for (int d = 0; d < rows; d++) /** d is the row of the matrix of minors **/
{
for (int m = 0; m < cols; m++) /** m is the column of matrix of minors **/
{
for (int i = 0; i < rows; i++) /** i is the row of the main martix **/
{
for (int j = 0; j < cols; j++) /** j is the column of the main matrix**/
(d == i || m == j)? dothis = false : dothis = true;
/** This is to determin if the number at postion (i,j) is part
of the determent for the matrix of minors. For postion (d,m)
of the matrix of minors, row d and colum m of the main matrix
are crossed out.**/
if (dothis == 'true')
{
/** postions for the determent matrix **/
detmin.set(mrtx.access(i,j), I, J);
/** this will set the determent matrix with the numbers
remaining from the cross-out prosecess. **/
I++;
J++;
}
}
}
detmin.display(3, 3); /** This makes sure the program did the
if statement **/
minor.set(detmin.twodert(), d, m);
/** takes the determent of the determent matrix and puts it
into the matrix of minors at posstion (d,m) **/
cout << endl << endl;
}
}
Программа соответствует требованиям, но когда я запускаю ее, программа отображает матрицу нулей 3x3. Я думаю, что внутреннее большинство утверждений if не распознается программой, и я понятия не имею, почему. Кто-нибудь знает, как я могу это исправить?
Редактировать Код теперь выглядит так же, как и выше, и все циклы работают. Это все еще не делает то, что я хочу, но я добился прогресса. Благодаря.