something

This commit is contained in:
2015-09-25 08:44:56 +03:00
commit 86f9da1a4e
29 changed files with 1298 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
package praktikum4;
public class table2 {
public static void main(String[] args) {
System.out.printf("Tabeli X suurus: ");
int x_size = lib.TextIO.getlnInt(); // table size in x direction
System.out.printf("Tabeli Y suurus: ");
int y_size = lib.TextIO.getlnInt(); // table size in y direction
// Create the table
for (int x = 0; x <= x_size; x++) {
System.out.printf("--");
}
System.out.printf("%n");
for (int x = 0; x <= x_size; x++) {
System.out.printf("| ");
for (int y = 0; y <= y_size; y++) {
if (x == y) {
System.out.printf("1 ");
} else {
System.out.printf("0 ");
}
}
//we are at the end of the line, start a new one
System.out.printf("%n");
}
}
}