From b10dc7ab4c7615b16810276a9f9cb2fe2c573d85 Mon Sep 17 00:00:00 2001 From: Angel Dimitriev Date: Fri, 2 Apr 2021 13:11:05 +0300 Subject: Add files via upload --- Sem. 05/Interval/Interval.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Sem. 05/Interval/Interval.h (limited to 'Sem. 05/Interval/Interval.h') diff --git a/Sem. 05/Interval/Interval.h b/Sem. 05/Interval/Interval.h new file mode 100644 index 0000000..432b368 --- /dev/null +++ b/Sem. 05/Interval/Interval.h @@ -0,0 +1,29 @@ + +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; +}; \ No newline at end of file -- cgit v1.3.1-23-gd82d