#include <iostream>
int main() {
while (true) {
int h, w;
std::cin >> h >> w;
if (h == 0 and w == 0) {
break;
}
for (int i = 0; i < h; i++) {
for (int j = 0; j < w; j++) {
if (i == 0 or j == 0 or i + 1 == h or j + 1 == w) {
std::cout << '#';
} else {
std::cout << '.';
}
}
std::cout << std::endl;
}
std::cout << std::endl;
}
}
|
オンラインジャッジではじめるC/C++プログラミング入門 (マイナビ)AIZU ONLINE JUDGE のコース問題を題材にした解説書です。各トピックごとに C/C++ 言語の基礎的な内容を学習し、Introduction to Programming の演習問題にチャレンジしていきます。内容は敷居の高いものではなく、プログラミング初学者が取り組む例題からスタートしています。 |