Advertisement
desislava_topuzakova

05. Character Sequence

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