Advertisement
Marin126

Aer372

Dec 18th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 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 AceptaElReto;
  7.  
  8. import java.util.Scanner;
  9.  
  10. /**
  11. *
  12. * @author anton
  13. */
  14. public class Aer372Medios {
  15.  
  16. public static void main(String[] args) {
  17. Scanner sc = new Scanner(System.in);
  18. String entrada = sc.nextLine();
  19.  
  20. String[] c = entrada.split("");//array de caracteres en orden
  21. String salida = "";
  22. for (int i = c.length - 1; i >= 0; i--) {
  23. salida = salida + entrada.charAt(i);
  24. }
  25.  
  26.  
  27. for (int i = 0; i < c.length; i++) {
  28. if(Character.isUpperCase(entrada.charAt(i)) ){
  29. System.out.print(Character.toUpperCase(salida.charAt(i)));
  30. }else if (Character.isLowerCase(entrada.charAt(i))){
  31. System.out.print(Character.toLowerCase(salida.charAt(i)));
  32. }else{
  33. System.out.print(salida.charAt(i));
  34. }
  35. }
  36. }
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement