|
*停權中*
|
引用:
|
作者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;
}
|