package day1;
public class Start1 {
public static void main(String[] args) {
// TODO Auto-generated method stub
for (int i = 1; i <= 5; i++) {
for (int j = 1; j <= 5; j++) {
if (i == j) {
System.out.print("[" + i + "," + j + "]");
} else {
System.out.print("______");
}
}
System.out.println();
}
}
}
package day1;
public class Start2 {
public static void main(String[] args) {
// TODO Auto-generated method stub
for(int i = 1; i<= 5; i ++) {
for(int j = 1; j <= 5; j ++) {
if(i == j) {
System.out.print("*");
}else {
System.out.print(" ");
}
}
System.out.println();
}
}
}
package day1;
public class Start3 {
public static void main(String[] args) {
// TODO Auto-generated method stub
for(int i = 1; i<= 5; i ++) {
for(int j = 1; j <= 5; j ++) {
if(i + j == 6) {
System.out.print("*");
}else {
System.out.print(" ");
}
}
System.out.println();
}
}
}
// 1 5 2 4 33 42 51
package day1;
public class Start4 {
public static void main(String[] args) {
// TODO Auto-generated method stub
for(int i = 1; i<= 5; i ++) {
for(int j = 1; j <= 5; j ++) {
if(i==j) {
System.out.print("*");
}else if(i + j ==6) {
System.out.print("*");
}else {System.out.print(" ");
}
}
System.out.println();
}
}
}
// 1,1 1,5 2,2 4,2 3,3 4,4 4,2 5,1 5,5 1 5 7 9 13 17 19 21 25
package day1;
public class Start5 {
public static void main(String[] args) {
// TODO Auto-generated method stub
for(int i = 1; i <= 5; i ++) {
for(int j = 1; j <= i; j++) {
if(i >= j) {
System.out.print("*");
}
}System.out.println();
}
}
}
package day1;
public class Start6 {
public static void main(String[] args) {
// TODO Auto-generated method stub
for(int i = 1; i <= 5; i++) {
for(int j = 1; j <= 1; j++) {
if(i <= j ) {System.out.print("*");
}else { System.out.print(" ");
}
}System.out.println();
}
}
}
// i 1 j 5 i 2 j 4 i 3 j 3 i 4 j 2 i 5 j 1
package day1;
public class Start7 {
public static void main(String[] args) {
// TODO Auto-generated method stub
for(int i = 1; i <=5; i ++ ) {
for(int j = 1; j<=5+i; j++) {
System.out.print("*");
} System.out.println();
}
}
}
package day1;
public class Start8 {
public static void main(String[] args) {
// TODO Auto-generated method stub
for (int i = 1; i <= 5; i++) {
for (int j = 1; j <= 9; j++) {
if (j + i <= 5) {
System.out.print(" ");
} else if (j - i >= 5) {
System.out.print(" ");
} else {
System.out.print("*");
}
}
System.out.println();
}
}
}
package day1;
public class Start9 {
public static void main(String[] args) {
// TODO Auto-generated method stub
for (int i = 1; i <= 5; i++) {
for (int j = 1; j <= 5; j++) {
if ((i + j <= 6 && i >= j) || (i <= j && i + j >= 6)) {
System.out.print("*");
} else {
System.out.print(" ");
}
}
System.out.println();
}
}
}
package day1;
public class Start10 {
public static void main(String[] args) {
// TODO Auto-generated method stub
for (int i = 1; i <= 5; i++) {
for (int j = 1; j <= 5; j++) {
if (!((i + j < 6 && i > j) || (i < j && i + j > 6))) {
System.out.print("*");
} else {
System.out.print(" ");
}
}
System.out.println();
}
}
}
package day1;
public class Start11 {
public static void main(String[] args) {
// TODO Auto-generated method stub
System.out.println();
// 주석
/*
* ctrl shift f 줄맞춤 alt + up down 행이동 // * 주석 ctrl D 한줄삭제
*/
// ctrl + / 토글
}
}
댓글