Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <string>
- using namespace std;
- int anz_gerade(int wert){
- while( wert>0 ){
- for(int n {wert%10}; wert%10 > 0; wert/=10){
- int sum{0};
- if(n%2 == 0)
- sum ++;
- else sum += 0;
- }
- return sum;
- }
- }
- int main (){
- int wert;
- cout << "Zahl: \n";
- cin >> wert;
- anz_gerade(wert);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement