Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class ReadText {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String text = scanner.nextLine();
- while (!text.equals("Stop")){
- System.out.println(text);
- text = scanner.nextLine();
- }
- }
- }
- ИЛИ:
- import java.util.Scanner;
- public class ReadText {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String text = scanner.nextLine();
- for(int i = 0; !text.equals("Stop"); i++){
- System.out.println(text);
- text = scanner.nextLine();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement