Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite9c1bcc

Browse files
authored
Update Exercise_12_02.java
1 parent6e8e489 commite9c1bcc

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

‎Exercise_12/Exercise_12_02/Exercise_12_02.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ public static void main(String[] args) {
1111
Scannerinput =newScanner(System.in);
1212
booleancontinueInput =true;
1313

14-
// Prompt the user to enter two integers
15-
System.out.print("Enter two numbers: ");
16-
do {
14+
while (continueInput) {
1715
try {
16+
System.out.print("Enter two numbers: ");
1817
intnumber1 =input.nextInt();
1918
intnumber2 =input.nextInt();
2019

@@ -29,6 +28,6 @@ public static void main(String[] args) {
2928
"Incorrect input: two integers are required) ");
3029
input.nextLine();// Discard input
3130
}
32-
}while (continueInput);
31+
} ;
3332
}
34-
}
33+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp