In ra hình vẽ sau:
Output
* * * * * * * * * *********** * * *
using namespace std; int main() { for (int i = 1; i <= 6; i++) { for (int j = 1; j <= 11; j++) if (i == 6 || i + j == 7 || i - j == -5) cout << ""; else cout << " "; cout << endl; } for (int i = 1; i <= 3; i++) { for (int j = 1; j <= 6; j++) if (j == 6) cout << ""; else cout << " "; cout << endl; } return 0; }
Bình luận
include <iostream>
using namespace std;
int main()
{
for (int i = 1; i <= 6; i++) {
for (int j = 1; j <= 11; j++)
if (i == 6 || i + j == 7 || i - j == -5)
cout << "";
else
cout << " ";
cout << endl;
}
for (int i = 1; i <= 3; i++) {
for (int j = 1; j <= 6; j++)
if (j == 6)
cout << "";
else
cout << " ";
cout << endl;
}
return 0;
}
13 bình luận nữa