Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int a,b;
- int liczba_cyfr(int a)
- {
- int b=1;
- int c=0;
- while (b<=a)
- {c++; b=b*10;}
- return c;
- }
- int main()
- {
- cout<<"podaj dowolna liczbe naturalna"<<endl;
- cin>>a;
- cout<<"liczba cyfr w podanej liczbie wynosi "<<liczba_cyfr(a);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement