Advertisement
desislava_topuzakova

05. Character Sequence

Jan 29th, 2022
982
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.         //"softuni"
  8.         //всяка позиция от 0 до послендата (дължина - 1)
  9.         //повтарям: взимам символа на позицията + отпечатвам
  10.         //начало: 0
  11.         //край: дължина - 1
  12.         //промяна: ++
  13.         for (int position = 0; position <= text.length() - 1; position++) {
  14.             char currentSymbol = text.charAt(position);
  15.             System.out.println(currentSymbol);
  16.         }
  17.     }
  18. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement