Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Ex8 {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- int n;
- do {
- System.out.println("Enter number: ");
- n = sc.nextInt();
- if (n != 0) {
- if (n % 3 == 0) {
- System.out.print("Пльок " + " ");
- }
- if (n % 5 == 0) {
- System.out.print("Пляс " + " ");
- }
- if (n % 7 == 0) {
- System.out.print("Пльос " + " ");
- }
- if ((n % 3 != 0) && (n % 5 != 0) && (n % 7 != 0)) {
- System.out.println(n);
- }
- System.out.println();
- } else {
- break;
- }
- } while (true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement