Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Scanner;
- public class Task8
- {
- public static void main(String[] args)
- {
- Scanner scanner = new Scanner(System.in);
- int inputNum = scanner.nextInt();
- while (inputNum != 0) {
- StringBuilder result = new StringBuilder();
- boolean isHere = false;
- if (inputNum % 3 == 0) {
- result.append("Пльок");
- isHere = true;
- }
- if (inputNum % 5 == 0) {
- result.append("Пляс");
- isHere = true;
- }
- if (inputNum % 7 == 0) {
- result.append("Пльос");
- isHere = true;
- }
- if (!isHere) {
- result.append(inputNum);
- }
- System.out.println(result.toString());
- inputNum = scanner.nextInt();
- }
- }
- }
Add Comment
Please, Sign In to add comment