1 条题解
-
1
#include<bits/stdc++.h> using namespace std; int main() { int s,n; char c; cin>>s>>c; n=sqrt((s+1)/2); for(int i=n;i>0;i--) { for(int j=0;j<n-i;j++) cout<<" "; for(int j=0;j<2*i-1;j++) cout<<c; cout<<endl; } for(int i=2;i<=n;i++) { for(int j=0;j<n-i;j++) cout<<" "; for(int j=0;j<2*i-1;j++) cout<<c; cout<<endl; } cout<<s-2*n*n+1; return 0; }
- 1
信息
- ID
- 306
- 时间
- 1000ms
- 内存
- 64MiB
- 难度
- 10
- 标签
- 递交数
- 4
- 已通过
- 3
- 上传者