1 条题解
-
0
C++ :
#include<bits/stdc++.h> using namespace std; long long n; int main() { cin>>n; for(int i=1,j=n-1,k=1;i<=n;i++,j--,k+=2) { for(int o=1;o<=j;o++) cout<<' '; for(int o=1;o<=k;o++) cout<<'*'; cout<<endl; } return 0; }Pascal :
var n,i,j:longint; begin readln(n); for i:=1 to n do begin write('':n-i); for j:=1 to i*2-1 do write('*'); writeln; end; end.
- 1
信息
- ID
- 2514
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- (无)
- 标签
- 递交数
- 0
- 已通过
- 0
- 上传者