瀏覽單個文章
bluse
*停權中*
 

加入日期: Mar 2003
文章: 3,129
引用:
作者Lordsaint
作業四:寫一程式列出下面圖形(for迴圈)
*****
***

***
*****


int main()
{
for(int j = 5;j>0;j--){
if(j%2 != 0)
for(int i = 0;i<j;i++){
cout<<'*';
}
else cout<<'\n';
}
for(int n = 2;n<6;n++){
if(n%2 != 0)
for(int m = 0; m<n;m++){
cout<<'*';
}
else cout<<'\n';
}
system("pause");
return 0;
}
舊 2011-09-20, 12:03 AM #53
回應時引用此文章
bluse離線中