Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package lista.Alapok;
- public class Main {
- public static boolean hasSharedDigit(int a, int b) {
- if((a<10 || a>99) || (b<10 || b>99)) return false;
- if ((a%10==b%10) || (a/10==b/10) || (a%10==b/10) || (a/10==b%10)) return true;
- else return false;
- }
- public static void main(String[] args) {
- System.out.println(hasSharedDigit(21, 32));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement