Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
332441 小林老师 【C3-4】菱形 C++ 通过 100 3 MS 244 KB 498 2025-07-14 21:59:52

Tests(2/2):


//菱形 #include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; //n-1行正等腰三角形 for(int i=1; i<=n-1; i++){ for(int j=1; j<=n-i; j++){ cout<<' '; } for(int j=1; j<=2*i-1; j++){ //形状打好,思考输出 cout<<j; } cout<<endl; } //n行倒正等腰三角形 for(int i=n; i>=1; i--){ for(int j=1; j<=n-i; j++){ cout<<' '; } for(int j=1; j<=2*i-1; j++){ cout<<j; } cout<<endl; } return 0; }


测评信息: