8 条题解
- 
  3#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; for(int i=1;i<=n;i++) { for(int k=1;k<=n;k++) { for(int j=1;j<=n-i;j++) { cout<<" "; } for(int j=1;j<=i*2-1;j++) { cout<<"*"; } for(int j=1;j<=n-i;j++) { cout<<" "; } cout<<" "; } cout<<endl; } return 0; }
- 
  0#include <iostream> using namespace std; const int INF = 0x3f3f3f3f; const int N = 1e5 + 10; int n; int main() { cin >> n; for(int i = 1; i <= n; i++)//代表行号 { for(int j = 1; j <= n - i; j++) cout << " "; for(int j = 1; j <= 2 * i - 1; j++) cout << "*"; for(int j = 1; j <= n - 1; j++) { for(int k =1 ; k <= 2 * n - 1 - 2 * (i - 1); k++) cout << " "; for(int j = 1; j <= 2 * i - 1; j++) cout << "*"; } cout << endl; } return 0; }
- 
  0#include #include #include using namespace std; int n; int main() { ** **cin>>n; ** **for(int i=1;i<=n;i++) ** **{ ** **for(int j=1;j<=n-i;j++) ** **{ ** **cout<<" "; ** **} ** **for(int k=1;k<=n;k++) ** **{ ** *for(int j=1;j<=2i-1;j++) ** **{ ** **cout<<"*"; ** **} ** for(int j=1;j<=2n-2i+1;j++) ** **{ ** **cout<<" "; ** **} ** **} ** **cout<<endl; ** **} ** **return 0; } 
- 
  -2
- 1
信息
- ID
- 956
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 4
- 标签
- 递交数
- 452
- 已通过
- 224
- 上传者
 
      