Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "pch.h"
- #include <iostream>
- #include <cmath>
- using namespace std;
- int IncrCheck(int num) {
- int buf = abs(num);
- if (buf < 10) return 1;
- while (buf > 9) {
- if (buf % 10 < (buf % 100 - buf % 10) / 10) return 0;
- buf /= 10;
- }
- return 1;
- }
- int main()
- {
- setlocale(LC_ALL, "rus");
- int num;
- cout << "Ввод последовательности: " << endl;
- cin >> num;
- while (num) {
- if (IncrCheck(num)) cout << "В числе " << num << "цифры расположены в порядке возрастания от старшего к младшему члену." << endl;
- cin >> num;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement