Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int previous, temp;
- bool isDone = false, isGrowing = true;
- cout << "Start entering your numbers:" << endl;
- cin >> previous;
- if (previous == 0) {
- cout << "No numbers in your subsequence";
- return 0;
- }
- while (isDone == false) {
- cin >> temp;
- if (temp == 0) {
- isDone = true;
- } else {
- if (previous > temp) {
- isGrowing = false;
- }
- previous = temp;
- }
- }
- cout << "Your subsequence is ";
- if (isGrowing == true) {
- cout << "growing";
- } else {
- cout << "not growing";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement