damesova

Count 3

Oct 31st, 2020
611
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int A;
  6.     int Sum = 0, Br = 0, Ost = 0;
  7.  
  8.     cout << "Vavedi num A = "; cin >> A;
  9.  
  10.     do {
  11.         Ost = A % 10;
  12.         A = A / 10;
  13.         if(Ost == 3){
  14.         Br++;
  15.         }
  16.    
  17.        
  18.  
  19.     } while (A != 0);
  20.  
  21.     cout << "Broi na 3-kie: " << Br << '\n';
  22.  
  23.     return 0;
  24. }
  25.  
RAW Paste Data