|| [[TableOfContents]] || = 피라미드 & 역피라미드 & 마름모 = == 재화 == {{{~cpp #include #include using namespace std; int main() { //피라미드 for(int i=0; i<5; i++) { string space(4-i,' '); cout << space; string star(2*i+1,'*'); cout< using namespace std; int main() { cout << "숫자를 입력하세요(행의 개수) = "; int row; cin >> row; // 피라미드&역피라미드 for (int i=0;i0;j--) cout << "*"; for (j=i+1;j0;j--) cout << " "; for (j=2*i+1;j<2*row;j++) cout << "*"; cout << endl; } // 마름모 for (i=0;i=0;j--) cout << " "; for (j=abs(row-i*2-1);j0;j--) cout << "*"; for (j=i;j0;j--) cout << " "; for (j=i;j0;j--) cout << "*"; cout << endl; } return 0; } }}} 올 대단한걸..^^ 잘해쓰~ 앞으로도 계속 열심히..[조재화] == 재선 == {{{~cpp #include #include using namespace std; int main() { int row; cin >> row; int j = 0; for(j = 0; j < row; j++) // 피라미드 { string spaces(row-(j+1), ' '); string asterisks(j*2+1, '*'); cout << spaces; cout << asterisks; cout << "\n"; } cout << "\n"; for(j = row - 1; j >= 0; j--) // 역피라미드 { string spaces(row-(j+1), ' '); string asterisks(j*2+1, '*'); cout << spaces; cout << asterisks; cout << "\n"; } cout << "\n"; int middle = row / 2 + 1; // 마름모 for (j = 0; j < middle; j++) { string spaces(middle-(j+1), ' '); string asterisks(j * 2 + 1, '*'); cout << spaces; cout << asterisks; cout << "\n"; } for (j = middle-1; j > 0; j--) { string spaces(row-(middle+j-1), ' '); string asterisks(j*2-1, '*'); cout << spaces; cout << asterisks; cout << "\n"; } return 0; } }}} == 보담 == {{{~cpp #include using namespace std; int main() { char star = '*'; char space = ' '; int number; int numberu; int dia; //피라미드 cout << "숫자를 입력하세요 : "; cin >> number; int i, j; for (i=0; i0; j--) cout << space; for (j=0; j<=i*2; j++) cout << star; cout << "\n"; } //역피라미드 cout << "숫자를 입력하세요 : "; cin >> numberu; for (i=0; i<=numberu; i++) { for (j=0; ji*2; j--) cout << star; cout << "\n"; } return 0; } }}} == 슬이 == {{{~cpp 난 잠시 바빠서 그날 한건만 올려놓고 곧 수정할께 ㅋㅋ 자료구조 숙제의 압박 ㅋㅋ 니네가 도와줘 ㅋㅋㅋ #include #include using namespace std; void main() {/* for(int row =0; row <5 ; row ++) { for (int col = 4-row ; col >0 ; col--) { cout <<" "; } for(int col2=1; col2 <=2*row +1 ; col2++){ cout <<"*"; } cout << endl; } //cout << endl; int temp =9; for(int row2 =0; row2 <5 ; row2++) { for(int col3 =0; col30;col4--) { cout << "*"; } temp = temp-2; cout << endl; } cout << endl;*/ int temp =9; for(int irow =0 ; irow <10; irow++) { for(int icol=0; icol <(abs(5-irow)) ; icol++) { cout <<"="; } for(int icol2=0; icol2 <=2*irow +1 ; icol2++){ cout <<"*"; } for(int icol3=temp ;icol3>0;icol3--) { cout << "*"; } temp=temp-2; cout << endl; } } }}} 마름모는 우선안됨 ㅋㅋ 마른모 얼른해서 올려봐~^^ [조재화] ---- [UpgradeC++]