Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
91419 | 罗迎甲 | 打印菱形 | C++ | Accepted | 4 MS | 272 KB | 367 | 2024-09-21 18:00:27 |
#include<bits/stdc++.h> using namespace std; int main() { int i,n,k,a; cin>>n; for(i=1;i<=n;i++){ for(k=1;k<=n-i;k++) cout<<" "; for(a=1;a<=i*2-1;a++) cout<<"*"; cout<<endl; } for(int z=1;z<=n-1;z++){ for(int x=1;x<=z;x++) cout<<" "; for(int x=1;x<=2*(n-z)-1;x++) cout<<"*"; cout<<endl; } return 0; }