-2
나는 형식과 간격을 가져 왔지만 어느 하나가 자바에서 실제 파스칼 삼각형 프로그램에서 인쇄하는 값을 얻기 위해 하나의 변화를 말할 수 있습니다 ...내 자신의 서면 파스칼 로직에서 약간의 변화를 말할 수 있습니다
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package patterns;
/**
*
* @author Love Poet
*/
public class p11 {
public static void main(String args[]) {
int row, col, count = 0;
for (row = 1; row <= 5; row++) {
for (col = 1; col <= 9; col++) {
if (((row + col) % 2 == 0) && (row + col >= 6)) {
System.out.print("* ");
count++;
} else if (count == row) {
break;
} else {
System.out.print(" ");
}
}
count = 0;
System.out.println();
}
}
}
** 내 출력 : ** -
*
* *
* * *
* * * *
* * * * *
내가 원하는 무엇 : -
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
내가 문제를 얻지 않는다합니다. 결과물이 예상대로 나오지 않습니까? – Thomas
기호 대신 숫자를 인쇄 하시겠습니까? – Baby
예 : - http://www.quickprogrammingtips.com/java/program-to-print-pascal-triangle-in-java.html –