2014년 4월 29일 화요일

c++ 다이아몬드 만들기


너무 오랜만에 프로그래밍해서 다이아몬드 만드는것도 헤맴;;

자주자주해야지;


-----------------------------------------------------------------------------

#include <iostream>
using namespace std;

int main(){
int count = 0;
for(int i = 0;i<9;i++){
for(int j = 0;j<9;j++){
if(j < 8-i){
cout << "  ";
}else {
cout << "ⓞ";
}
}
count = 0;
while(count < 9){
if(count <i){
cout << "ⓞ";
}else{
cout << "  ";
}
count++;
}
cout << endl;
}
for(int i = 0;i<8;i++){
for(int j = 0;j<8;j++){
if(i < j){
cout << "ⓞ";
}else {
cout << "  ";
}
}
count = 0;
while(count < 8){
if(count <i){
cout << "";
}else{
cout << "ⓞ";
}
count++;
}
cout << endl;
}



return 0;
}

댓글 없음:

댓글 쓰기