Skip to content

Commit

Permalink
Lucky Numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
SE-MahmoudAbdelaal committed May 24, 2024
1 parent 9cb81fd commit 2fbb958
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions CodeForces/Contest #1/Lucky Numbers/Solution.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import java.util.Scanner;

/**
* Solution
*/
public class Solution {

public static void main(String[] args) {
Scanner scanner=new Scanner(System.in);
int Number=scanner.nextInt();
if (Number<10) {
System.out.println("NO");
}else{
int lastDigit=Number%10;
int firstDigit=Number/10;
if (lastDigit%firstDigit==0||firstDigit%lastDigit==0 ) {
System.out.println("YES");

}else{
System.out.println("NO");
}
}


}
}

0 comments on commit 2fbb958

Please sign in to comment.