Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class demo {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String text = scanner.nextLine();
- //за всяка една позиция от стринга 0 до последната
- //взимаме символа на тази позиция; печатаме символа
- //отиваме на следващата позиция
- for (int position = 0; position <= text.length() - 1 ; position++) {
- char symbol = text.charAt(position);
- System.out.println(symbol);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement