You are viewing a single comment's thread. Return to all comments →
/** * * @author Anutrix */ import java.io.*; import java.util.*; public class Encrytion { public static void main(String[] args) { Scanner in = new Scanner(System.in); String msg = in.nextLine(); int n = msg.length(); int y = (int) Math.ceil(Math.sqrt(n)); for(int i=0; i<y; i++){ int pos = i; while(pos<n){ System.out.print(msg.charAt(pos)); pos +=y; } System.out.print(" "); } } }
Hows this?
Seems like cookies are disabled on this browser, please enable them to open this website
Encryption
You are viewing a single comment's thread. Return to all comments →
Hows this?