desislava_topuzakova

05. Character Sequence

Oct 2nd, 2021
965
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.70 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class StreamOfLetters_05 {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         String text = scanner.nextLine();
  7.         //всички позиции от 0 до последната
  8.         //повтарям: взема символа на позицията + отпечатам
  9.         //начална стойност: 0
  10.         //крайна стойност: дължина - 1
  11.         //промяна: + 1
  12.         for (int position = 0; position <= text.length() - 1; position++) {
  13.             char currentSymbol = text.charAt(position);
  14.             System.out.println(currentSymbol);
  15.         }
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment