From 97b4d62734acf7533a96b08bcc6044eb94847931 Mon Sep 17 00:00:00 2001 From: Justsvetoslavov Date: Thu, 13 Jan 2022 21:15:47 +0200 Subject: Add Pract. solutions. --- pract_SI/Pract. 09/task4.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 pract_SI/Pract. 09/task4.cpp (limited to 'pract_SI/Pract. 09/task4.cpp') diff --git a/pract_SI/Pract. 09/task4.cpp b/pract_SI/Pract. 09/task4.cpp new file mode 100644 index 0000000..d89c934 --- /dev/null +++ b/pract_SI/Pract. 09/task4.cpp @@ -0,0 +1,15 @@ +bool Is_monotonically_increasing(const float* seq,int length,int position) +{ + if(position==length-1) + return true; + if(seq[position]>seq[position+1]) return false; + return Is_monotonically_increasing(seq,length,position+1); +} + +bool Is_rising(const float* seq,int Size) +{ + if(Size<2) return true; + if(seq>(seq+1)) return false; + /// if(seq[0]>seq[1]) return false; -same + return Is_rising(++seq,Size-1); +} \ No newline at end of file -- cgit v1.3.1-23-gd82d