Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. /*
  2. * To change this license header, choose License Headers in Project Properties.
  3. * To change this template file, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. package hovinko;
  7. import java.util.Scanner;
  8. /**
  9. *
  10. * @author Filip
  11. */
  12. public class Hovinko {
  13.  
  14. /**
  15. * @param args the command line arguments
  16. */
  17. public static void main(String[] args) {
  18. Scanner sc = new Scanner (System.in, "Windows-1250");
  19. String vstup;
  20. String obrat;
  21.  
  22. System.out.println("ukaž co chceš obrátit kundo!");
  23. vstup = sc.nextLine();
  24. char pole[] = vstup.toCharArray();
  25. char[] obratPole = new char [pole.length];
  26. for (int i = pole.length - 1; i >=0; i--){
  27. obratPole[i] = pole[pole.length-i-1];
  28. }
  29. System.out.println(obratPole);
  30. }
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement