Advertisement
Guest User

VERBESSERT

a guest
Oct 31st, 2014
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class uebung5_3p {
  5.  
  6.  
  7. public static void main(String[] args) {
  8.  
  9. int k;
  10. int kneu;
  11. String b;
  12. String a ="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  13.  
  14. Scanner eingabe = new Scanner(System.in);
  15.  
  16. k = eingabe.nextInt();
  17. b = eingabe.next();
  18. b = b.toUpperCase();
  19.  
  20. String neu="";
  21. kneu = k %26;
  22.  
  23. for (int index=0;index < 26;index++)
  24. {
  25. String vergleich=""+ a.charAt(index);
  26.  
  27. if (b.equals(vergleich))
  28. {
  29. b = vergleich;
  30. neu =""+ a.charAt(index+kneu);
  31. }
  32.  
  33. }
  34.  
  35. System.out.println(neu);
  36.  
  37.  
  38. }
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement