josiftepe

Untitled

Nov 15th, 2020
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.78 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int n;
  8.     cin >> n;
  9.     int arr[n];
  10.     int zbir=0;
  11.     int zbir_na_tipki=0;
  12.     for(int i=0;i<n;i++){
  13.         cin>>arr[i];
  14.     }
  15.     for(int i=0;i<n;i++){
  16.              
  17.            if  (arr[i]%2==0) {
  18.                int golemina_na_brojot = 0;
  19.         while(arr[i]%2==0){
  20.              
  21.             golemina_na_brojot += 1;
  22.             if(arr[i]%2!=0){
  23.  
  24.                 break;
  25.             }
  26.             arr[i] /= 10;
  27.             if(arr[i]==0){
  28.                     zbir+=1;
  29.                 zbir_na_tipki += golemina_na_brojot;
  30.                 break;
  31.             }
  32.                
  33.         }
  34.  
  35.     }
  36.     }
  37.              
  38.  
  39.  
  40.  
  41.     cout<<zbir<<endl;
  42.     cout<<zbir_na_tipki<<endl;
  43.  
  44.     return 0;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment