?? fraction.h
字號:
// Fraction.h: interface for the CProperFractionReduce class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_FRACTION_H__1AC44A8A_1C4E_4B58_82E5_038674E8C273__INCLUDED_)
#define AFX_FRACTION_H__1AC44A8A_1C4E_4B58_82E5_038674E8C273__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define MAXSIZE 1024
class CProperFractionReduce
{
public:
CProperFractionReduce();
virtual ~CProperFractionReduce();
public:
int max_div(int x,int y);//最大公約數(shù)
int min_mul(int x,int y);//最小公倍數(shù)
static int compare(const void *first,const void *second);
int srch_div(int x);
int calculate(int fractcnt);
int combnum(int neednum,int begnum,int leftnum);
int workitout(int x,int y);
private:
int databuf[MAXSIZE],idxbuf[MAXSIZE];//約數(shù)緩沖,索引數(shù)緩沖
int datacnt,idxcnt;//約數(shù)個數(shù),索引數(shù)個數(shù)
int calnum,calden;//計算用分子,分母
int bestbuf[MAXSIZE];//最佳組合的約數(shù)緩沖區(qū)
int bestcnt;//最佳組合的約數(shù)個數(shù)
};
#endif // !defined(AFX_FRACTION_H__1AC44A8A_1C4E_4B58_82E5_038674E8C273__INCLUDED_)
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -