Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
2815 吴奕希 打印菱形 C++ Accepted 0 MS 260 KB 297 2024-03-02 13:11:39

Tests(10/10):


Code:

# include<iostream> # include<cmath> using namespace std; int main(){ int a; cin>>a; for(int i = 1; i <= 2*a-1; i++){ for(int b = abs(a-i); b >= 1; b--)cout<<" "; for(int b = 1; b <= (a-abs(a-i))*2-1; b++)cout<<"*"; cout<<endl; } return 0; }