Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
125247 晏莞煜 打印菱形 C++ Accepted 2 MS 272 KB 423 2025-07-14 10:51:18

Tests(10/10):


Code:

#include<iostream> using namespace std; int main(){ int n; cin>>n; int k=0,y=1; int w=1; for(int i=n-k;i>0;i--){ for(int u=n-y;u>0;u--){ cout<<" "; } for(int q=1;q<=w;q++){ cout<<"*"; } k++; w+=2; y++; cout<<endl; } for(int i=1;i<=n-1;i++){ for(int j=1;j<=i;j++){ cout<<" "; } for(int g=(n-i)*2-1;g>=1;g--){ cout<<"*"; } cout<<endl; } return 0; }