Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
83045 游四鑫 打印菱形 C++ Wrong Answer 1 MS 272 KB 396 2024-07-14 08:59:22

Tests(0/10):


Code:

#include<iostream> using namespace std; long long a; int main(){ int a; cin>>a; for(int i=1;i<=a;i++){ for(int q=1;q<=a-i;q++){ cout<<' '; } for(int j=1;j<=i*2-1;j++){ cout<<"*"; } cout<<endl; } for(int i=a;i>=1;i--){ for(int q=a-i;q>=1;q--){ cout<<' '; } for(int j=i*2-1;j>=1;j--){ cout<<"*"; } cout<<endl; } return 0; }


Run Info:

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