Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
63409 祝家懿 打印菱形 C++ Wrong Answer 1 MS 268 KB 448 2024-01-07 16:45:58

Tests(0/10):


Code:

#include<bits/stdc++.h> using namespace std; int main() { int a; cin>>a; int x=1; int z=a-1; for(int i=1;i<=a;i++){ for(int k=1;k<=z;k++){ cout<<' '; } z--; for(int j=1;j<=x;j++){ cout<<"*"; } cout<<endl; x+=2; } z=1; x=a; for(int i=1;i<=a-1;i++){ for(int k=0;k<=z;k++){ cout<<' '; } z++; for(int j=1;j<=x;j++){ cout<<"*"; } cout<<endl; x-=2; } return 0; }


Run Info:

------Input------
5
------Answer-----
* *** ***** ******* ********* ******* ***** *** *
------Your output-----
* *** ***** ******* ********* ***** *** *