Advertisement
veronikaaa86

05. Character Sequence

Oct 23rd, 2021
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. package forLoop;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class P05CharacterSequence {
  6. public static void main(String[] args) {
  7. Scanner scanner = new Scanner(System.in);
  8.  
  9. String text = scanner.nextLine();
  10. //softuni
  11.  
  12. //0 -> s
  13. //1 -> o
  14. //2 -> f
  15. //3 -> t
  16. //4 -> u
  17. //5 -> n
  18. //6 -> i
  19.  
  20. int length = text.length();
  21. for (int i = 0; i < length; i++) {
  22. char symbol = text.charAt(i);
  23.  
  24. System.out.println(symbol);
  25. }
  26. }
  27. }
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement