Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int nombre_xifres(int n) {
- int w = 1;
- while (n/10 != 0) {
- ++w;
- n /= 10;
- }
- return w;
- }
- bool es_creixent(int n) {
- int xifres = nombre_xifres(n);
- for (int i = 1; i == xifres; ++i) if(n[i] < n[i+1]) return false;
- return true;
- }
Add Comment
Please, Sign In to add comment