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