Advertisement
PiotrJurek

Zad23

Mar 30th, 2020
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int LICZBA_CYFR(int n)
  6. {
  7. int x=0;
  8. for(n; n>0; n=n/10)
  9. {
  10. x++;
  11. }
  12. return x;
  13. }
  14.  
  15. int main()
  16. {
  17. cout << LICZBA_CYFR(546) << endl;
  18. cout << LICZBA_CYFR(90909090) << endl;
  19. cout << LICZBA_CYFR(24176) << endl;
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement