標題: Porgramming Problem [打印本頁] 作者: j1a2c3k4y5 時間: 2006-11-29 11:05 標題: Porgramming Problem
I really don't know how to do this question
I feel sorry that i have to post the question to all of you
WOuld somebody help me plz
I only want the algorithm,don't need code. 作者: hhl 時間: 2006-11-29 12:16
I think a very unitelligent algorithm is :
Array of coin = C(1,1) to C(n,n)
for (i=1; i < n; i++) {
for (j=1; j=n; j++) {
if C(i,j) == "T" then Flip(C(i+1,j));
}
}
This algorithm is straight forward and will flip the lowest number column into all heads first, ( by flipping coins in the next higher column ). It then flips the next higher column until all columns are traverse... 作者: Rubber 時間: 2006-12-6 17:02
By the way... this only garrantees the first 1..(n-1) column are all heads, is it mathematically fixed that the (n) column must be also all heads if the first n-1 colums are all heads ?