Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- long a;
- void input() {
- cout << "Enter a: ";
- cin >> a;
- }
- int countZeroes(long num) {
- int count = 0;
- while (num != 0) {
- if (num % 10 == 0) {
- count++;
- }
- num /= 10;
- }
- return count;
- }
- int main() {
- input();
- cout << "Result: " << countZeroes(a) << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement