C++面向过程解决三阶行列式问题

时间:2024-06-27 16:05:14
#include<iostream>
#include <cstdlib>
using namespace std;
int print()
{
    cout<<"************************************************"<<endl;
    cout<<"*               欢迎使用本软件                  *"<<endl;
    cout<<"************************************************"<<endl<<endl;
    cout<<"请输入三阶行列式(以回车键换行):"<<endl;

}
int main()
{
    int a,b,c,d,e,f,j,h,i;
    print();
    while(cin>>a>>b>>c>>d>>e>>f>>j>>h>>i)
    {
        cout<<endl;
        cout<<"行列式结果为:";
        cout<<a*e*i+d*h*c+b*f*j-c*e*j-f*h*a-b*d*i<<endl<<endl;
        system("pause");
        system("cls");
        print();

    }
}