📄 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);//最大公约数
int min_mul(int x,int y);//最小公倍数
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];//约数缓冲,索引数缓冲
int datacnt,idxcnt;//约数个数,索引数个数
int calnum,calden;//计算用分子,分母
int bestbuf[MAXSIZE];//最佳组合的约数缓冲区
int bestcnt;//最佳组合的约数个数
};
#endif // !defined(AFX_FRACTION_H__1AC44A8A_1C4E_4B58_82E5_038674E8C273__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -