Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
9317 | D班-汤依宁 | 半菱形 | C++ | 通过 | 100 | 1 MS | 260 KB | 404 | 2025-04-12 08:22:35 |
#include<bits/stdc++.h> using namespace std; int main() { int i,n,j,k,c=5,b=1; cin>>n; c=n-1; for(int i=1; i<=n; i++) { for(int j=1; j<=n-i; j++) { cout<<" "; } for(int k=1; k<=i; k++) { cout<<"*"; } cout<<endl; } for(int i=1; i<=n; i++,b++,c--) { for(int j=1; j<=b; j++) { cout<<" "; } for(int k=1; k<=c; k++) { cout<<"*"; } cout<<endl; } }