Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- *
- * Solution to homework task
- * Introduction to programming course
- * Faculty of Mathematics and Informatics of Sofia University
- * Winter semester 2017/2018
- *
- * @author NATALIJA STOJANOVA
- * @idnumber 855301
- * @task 6
- * @compiler GCC
- *
- */
- #include <iostream>
- using namespace std;
- int main ()
- {
- int Number=0,AuxiliaryVariable=0,Counter=0,Counter2=1;
- cout<<"Enter integers and press ENTER, when you want to finish the row enter 0 or negative number "<<endl;
- cin>>Number;
- cout<<Number;
- while (Number!=AuxiliaryVariable)
- {
- AuxiliaryVariable=Number;
- cin>>Number;
- if(Number<=0)
- {
- break;
- }
- if (Number>AuxiliaryVariable)
- Counter++;
- if (Number<AuxiliaryVariable)
- Counter=Counter+0;
- Counter2++;
- if(Counter%(Counter2-1)!=0)
- {
- cout<<"Your row is undefined"<<endl;
- break;
- }
- }
- if (AuxiliaryVariable!=Number)
- {
- if (Counter==0)
- cout<<"Your row is decreasing"<<endl;
- if ((Counter+1)%Counter2==0)
- cout<<"Your row is increasing"<<endl;
- }
- else
- cout<<"Your row is undefined"<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement