Submission #02971


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include <bits/stdc++.h>
using namespace std;
int n;
string a = " *";
string b = " ";
int main()
{
cin >> n;
if (n == 1) {
cout << a << endl;
}
else {
for (int i = 0; i < n; i++) {
cout << a;
for (int j = 1; j < n-1; j++) {
if (i == 0 || i == n - 1) {
cout << a;
}
else {
cout << b;
}
}
cout << a << endl;
}
}
}

ステータス

項目 データ
問題 0378 - 正方形の描写
ユーザー名 ei1439
投稿日時 2016-04-07 13:43:16
言語 C++11
状態 Accepted
得点 1
ソースコード長 414 Byte
最大実行時間 12 ms
最大メモリ使用量 560 KB

セット

セット 得点 Cases
1 ALL 1 / 1 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
input1.txt AC 11 ms 472 KB
1
input2.txt AC 12 ms 452 KB
1
input3.txt AC 11 ms 560 KB
1
input4.txt AC 11 ms 408 KB
1