Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
91416 | 罗迎甲 | 打印菱形 | C++ | Wrong Answer | 1 MS | 268 KB | 354 | 2024-09-21 17:56:14 |
#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);x++) cout<<"*"; cout<<endl; } return 0; }
------Input------
5
------Answer-----
* *** ***** ******* ********* ******* ***** *** *
------Your output-----
* *** ***** ******* ********* ******** ****** **** **