Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Test {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String input = "";
- String text = "";
- while (true) {
- input = scanner.nextLine();
- if ("stop".equals(input)) {
- break;
- }
- char symbol = input.charAt(0);
- text = text + symbol;
- }
- System.out.println(text);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment