ValerianBenchea

+++NumarulDeCifre

May 25th, 2020
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.19 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.   int n, k=0;
  8.   cin>>n;
  9.   if(n==0)
  10.     cout<<1;
  11.   while(n)
  12.   {
  13.     k++;
  14.     n=n/10;
  15.   }
  16.     if(k)
  17.         cout<<k;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment