Advertisement
bogolyubskiyalexey

fiiling text in rect

Oct 28th, 2017
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1. package com.company;
  2.  
  3. public class DoubleReshuffleMethod extends CezarCryptoMethods{
  4.     DoubleReshuffleMethod(String text, String xaxis, String yaxis) {
  5.         char [][] array = new char[yaxis.length()][xaxis.length()];
  6.        
  7.         int index = 0;
  8.         for(int j = 0; j < yaxis.length(); ++j){
  9.             for(int k = 0; k < xaxis.length(); ++k) {
  10.                 array[j][k] = text.charAt(index++);
  11.             }
  12.         }
  13.         for (int i=0; i<yaxis.length(); i++) {
  14.             for (int j=0; j<xaxis.length(); j++)
  15.                 System.out.print(array[i][j]);
  16.             System.out.println();
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement