fork download
  1. import java.util.*;
  2. import java.math.*;
  3.  
  4. class Main
  5. {
  6. public static void main (String[] args)
  7. {
  8. Scanner in = new Scanner(System.in);
  9. in.useDelimiter(""); //Чтение по одному символу.
  10.  
  11. int a = (int)in.next().charAt(0); //Первый ключ
  12. int c = (int)in.next().charAt(0); //Пробел
  13. int b = (int)in.next().charAt(0); //Второй ключ
  14. c = (int)in.next().charAt(0); //Пробел
  15.  
  16. while(in.hasNext()){
  17. c = (int)in.next().charAt(0);
  18. System.out.print((char)((c*a+b)%256));
  19. System.out.print((char)((c*a+b)/256));
  20. }
  21. }
  22. }
Success #stdin #stdout 0.08s 2841600KB
stdin
f n Kittens
stdout
PD*¦.¦.¬(B,@.