Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
126573 | 王镜铭 | 打印三角形 | C++ | Accepted | 4 MS | 272 KB | 250 | 2025-07-21 10:36:25 |
#include <iostream> using namespace std; int main() { int i, i1; cin >> i; i1=i; for(int n=1,y=1;n<=i;n++,y+=2){ for(int x=1;x<=i-n;x++){ cout<<" "; } for(int z=1;z<=y;z++){ cout<<"*"; } cout<<endl; } return 0; }