问题描述
- C++ 计算行列式的方法
- C++新手,想要用C++实现一个计算行列式值的函数,行列式的输入储存方法已经完成(代码如下),求determinant函数(即计算行列式的值)部分的写法,谢谢!
#include <iostream>#include <iomanip>using namespace std;void square(){ int in_n; cin >> in_n; const int n = in_n; int square[n][n]; int squarei[n]; for(int j = 0;j < n;j ++) { for(int i = 0;i < n;i ++) { cin >> squarei[i]; square[j][i] = squarei[i]; } } cout << endl; for(int j = 0;j < n;j ++) { for(int i = 0;i < n;i ++) { cout << square[j][i] << "" ""; } cout << endl; } determinant(square);}void determinant(int square){}int main(){ square(); return 0;}
解决方案
参考:http://download.csdn.net/detail/gym1234566/4266547
http://wenku.baidu.com/link?url=_KPP-NgGJ9uzEcOAoXebj4pF_JQQn5Ph64hvyE8cxtrG_9Aanp4IhyRdyf2qcLJ_caOTg0JuLibzLX81NwJdWjNeMNNicUeFMNE16ilOYny
时间: 2024-12-02 05:15:07