Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package exediv7;
- public class Main
- {
- public static void main(String[] args)
- {
- System.out.println(div7(68089));
- }
- private static boolean div7(int n)
- {
- int pre = n/10;
- int cn = n - pre*10;
- int somma = pre + cn*5;
- for(int i=1; i < somma ;i++)
- {
- if(i*7==somma) return true;
- }
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement