?? pan_dan.cpp
字號:
#include "pan_dan.h"pan_dan::pan_dan(){}pan_dan::pan_dan(ji_he a){ this->a=a; gx=guan_xi(a,a);}int pan_dan::zf(){ int sum=0; for(int i=0;i<a.get_num();i++){ if(gx.get_gx(i,i)==true) sum++; } if(sum==a.get_num()) return ZF; else if(sum==0) return FZF; else return NO;}int pan_dan::dc(){ int dc=0; int fdc=0; int num=a.get_num(); for(int i=0;i<num;i++){ for(int j=0;j<num;j++){ if(gx.get_gx(i,j)==true&&gx.get_gx(j,i)==true) dc++; else if(gx.get_gx(i,j)==true&&gx.get_gx(j,i)==false) fdc++; } } if(dc>0&&fdc>0) return NO; else if(dc>=0&&fdc==0) return DC; else return FDC;}int pan_dan::cd(){ int num=a.get_num(); for(int i=0;i<num;i++){ for(int j=0;j<num;j++){ if(i==j) continue; else if(gx.get_gx(i,j)==true){ for(int k=0;k<num;k++){ if(j==k) continue; else if(gx.get_gx(j,k)==true) if(gx.get_gx(i,k)==false) return NO; } } } } return CD;}ji_he pan_dan::get_a(){ return a;}guan_xi pan_dan::get_gx(){ return gx;}pan_dan::~pan_dan(){}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -