DN02
This commit is contained in:
parent
063f5feb2d
commit
8e0baa5eb7
22
src/DN02.java
Normal file
22
src/DN02.java
Normal file
|
@ -0,0 +1,22 @@
|
|||
public class DN02 {
|
||||
|
||||
public static void main(String[] args) {
|
||||
String besedilo = args[0];
|
||||
|
||||
int n = (int) Math.ceil(Math.sqrt(besedilo.length()));
|
||||
|
||||
int i = 0;
|
||||
for (int j = 0; j < n; j++) {
|
||||
for (int k = 0; k < n; k++) {
|
||||
if (i >= besedilo.length()) {
|
||||
System.out.print(" . ");
|
||||
continue;
|
||||
}
|
||||
System.out.print(" " + besedilo.charAt(i) + " ");
|
||||
i++;
|
||||
}
|
||||
System.out.println();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user