Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class LucyEx1
- {
- public static int AmmountNum(int n){
- if(n<10) return 1;
- return 1 + AmmountNum(n/10);
- }
- public static int SumAmmountNum(int n){
- if(n<10) return n;
- return n%10 + SumAmmountNum(n/10);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement