Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
98381 | Kevin | 打印三角形 | C++ | Accepted | 5 MS | 268 KB | 266 | 2024-11-20 15:58:30 |
#include<bits/stdc++.h> using namespace std; int main(){ int n,m,z=1; cin>>n; m=n-1; for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ cout<<" "; } for(int j=1;j<=z;j++){ cout<<"*"; } z+=2; m--; cout<<endl; } return 0; }