Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package AceptaElReto;
- import java.util.Scanner;
- /**
- *
- * @author anton
- */
- public class Aer372Medios {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- String entrada = sc.nextLine();
- String[] c = entrada.split("");//array de caracteres en orden
- String salida = "";
- for (int i = c.length - 1; i >= 0; i--) {
- salida = salida + entrada.charAt(i);
- }
- for (int i = 0; i < c.length; i++) {
- if(Character.isUpperCase(entrada.charAt(i)) ){
- System.out.print(Character.toUpperCase(salida.charAt(i)));
- }else if (Character.isLowerCase(entrada.charAt(i))){
- System.out.print(Character.toLowerCase(salida.charAt(i)));
- }else{
- System.out.print(salida.charAt(i));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement