Advertisement
Josif_tepe

Untitled

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