#include <iostream> |
int width=21;
for( int i=0 ; i<width ; i++ ){
std::cout << "*";
}
std::cout << "\n";
|
int width=21;
int height=11;
for( int j=0 ; j<height ; j++ ){
for( int i=0 ; i<width ; i++ ){ // この部分は演習 1 のまま
std::cout << "*"; //
} //
std::cout << "\n"; //
}
|
int width=21;
int height=11;
for( int j=0 ; j<height ; j++ ){
for( int i=0 ; i<width ; i++ ){
if( i==width/2 && j==height/ 2){ // ここが変更点
std::cout << "0"; //
}else{ //
std::cout << "*"; //
} //
}
std::cout << "\n";
}
|