Website Summary Files Commits Branches @commit @diff @stats
path: root / Sem. 05 / Interval / Interval.h
blob: c8fcbc70965c64bdea37087f7dfeb4856c93e048 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

class Interval
{
	int a;
	int b;

	size_t countNumbersInIntervalCondition(bool(*pred)(int)) const;

public:

	Interval();
	Interval(int a, int b);
	
	int getA() const;
	int getB() const;

	void setA(int a);
	void setB(int b);

	size_t getLength() const;
	bool isMemberOfInterval(int x) const;

	size_t calcPrimeNumbersInTheInterval() const;
	size_t calcPalindromicNumbersInTheInterval() const;
	size_t calcDiffrentDigitNumbersInTheInverval() const;
	
	bool areStartAndEndPowersOfTwo() const;
	
	Interval intersect(const Interval& other) const;
	
	bool isSuperInterval(const Interval& other) const;
};