arrow_forward همه ارسال‌ها

جزئیات ارسال کد#322

verified
وضعیت داوری نهایی: پذیرفته شد
terminal
زبان برنامه‌نویسی: C++
schedule
ارسال‌کننده و زمان:
Kiarash Hamini (۲ سال پیش)
descriptionsolution.cpp ۲۴ خط • ۴۴۵ بایت
1#include <iostream>
2#include <cmath>
3using namespace std;
4
5int main()
6{
7 int n;
8 cin >> n;
9 for (int i = 1; i <= n; i++)
10 {
11 for (int j = 1; j <= n; j++)
12 {
13 if (j == 1 || j == n || i == j || i == 1 || i == n || i + j == n + 1)
14 {
15 cout << "*";
16 }
17 else
18 cout << " ";
19 }
20 cout << "\n";
21 }
22
23 return 0;
24}
کد ارسال‌شده برای داوری خودکار هاتکدز UTF-8