Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package WhileLoop;
- import java.util.Scanner;
- public class ReadWords_01 {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- //1. повтаряме: отпечатваме въведената дума
- //2. спираме: думата == "Stop"
- //3. продължавам: думата != "Stop"
- String word = scanner.nextLine();
- while (!word.equals("Stop")) {
- System.out.println(word);
- word = scanner.nextLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement