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

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

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