close
標題:

 

此文章來自奇摩知識+如有不便請留言告知

C語言迴圈

發問:

1...*... ..***.. .*****. ******* .*****. ..***.. ...*... 2.123456789 1234567 12345 123 1 3. 1 23 456 4.A BC DEF GHIJ KLMNO 5.abcde abcd abc ab a

最佳解答:

第一題: 不知道你有沒有要把其中的...顯示出來,如果沒有,只想顯示*號 code如下,如果有要顯示出...,把三個//拿掉 char i,j,k,temp; cout.setf(ios::right,ios::adjustfield); //cout.fill('.'); for(i=0,k=6;i<4||k>=0;i++,k--){ if(k>2)temp=i; else temp=k; cout.width(4-temp); for(j=0;j<2*temp+1;j++) cout<<'*'; //if((j==2*temp+1)&&i!=3) //{cout.width(4-temp-1);cout<<'.'; } cout<
其他解答:6FE6251C5F3F8A0F
arrow
arrow

    yffuhxy 發表在 痞客邦 留言(0) 人氣()