Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int liczba,b=1;
- int liczba_cyfr(int liczba)
- {
- while(liczba=liczba/10)
- {
- b++;
- }
- return b;
- }
- int main()
- {
- cout << "Podaj liczbe: ";
- cin >> liczba;
- if(liczba<0)
- {
- cout<<"Podaj liczbe naturalna nastepnym razem :)"<<endl;
- return 0;
- }
- cout<<"Ta liczba posiada: "<<liczba_cyfr(liczba)<<" cyfr";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement