Guest User

Untitled

a guest
May 24th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int nombre_xifres(int n) {
  5. int w = 1;
  6. while (n/10 != 0) {
  7. ++w;
  8. n /= 10;
  9. }
  10. return w;
  11. }
  12.  
  13. bool es_creixent(int n) {
  14. int xifres = nombre_xifres(n);
  15. for (int i = 1; i == xifres; ++i) if(n[i] < n[i+1]) return false;
  16. return true;
  17. }
Add Comment
Please, Sign In to add comment