006-005-002

Break and Continue: Loop Control

Easy

Problem Description

Break and Continue: Loop Control

In this problem, you will create a program that iterates through numbers 1 to 10, skips multiples of 3 using continue, stops at 8 using break, and displays the result to standard output.

Learning Objective: Understand how to control loop flow using break and continue statements

Overview

Create a program that processes numbers 1 to 10, skipping or stopping on certain conditions.

Specifications

  • Loop from 1 to 10
  • Skip multiples of 3 with continue
  • Stop at 8 with break
  • Output numbers that are not skipped or stopped

Output Format

Processing: 1
Processing: 2
Processing: 4
Processing: 5
Processing: 7
Stopped at 8

Test Cases

※ Output examples follow programming industry standards

Input:
Expected Output:
Processing: 1
Processing: 2
Processing: 4
Processing: 5
Processing: 7
Stopped at 8
Input:
Expected Output:
Processing: 1
Processing: 2
Processing: 4
Processing: 5
Processing: 7
Stopped at 8
Input:
Expected Output:
Processing: 1
Processing: 2
Processing: 4
Processing: 5
Processing: 7
Stopped at 8
Input:
Expected Output:
Processing: 1
Processing: 2
Processing: 4
Processing: 5
Processing: 7
Stopped at 8
❌ Some tests failed
❌ エラー発生

Your Solution

Current Mode: My Code
import java.util.Scanner;

public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// Write your code here

sc.close();
}
}
0 B / 5 MB

You have 9 free executions remaining