Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int count7(int n) {
- if(n==0){
- return 0;
- }else if((n%10)==7){
- return 1 + +count7(n/10);
- }else{
- return 0 + +count7(n/10);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement