logo AlgoBeat OnlineJudge
登录 注册

题解

作者: tyxx040105  ·  发布于 2026-07-19 21:42:13  ·  最后修改于 2026-07-20 2:31:38
已通过
审核员:UnratedCheater Bug · 2026-07-20 2:31:38

模拟即可。

#include<bits/stdc++.h>
using namespace std;
int n;
int main(){
	cin>>n;
    n*=2;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n-i;j++) cout<<" ";
        if(i&1){
            for(int j=1;j<=(i+1)/2;j++){
                cout<<"/\\  ";
            }
        }
        else{
            for(int j=1;j<=i/2;j++){
                cout<<"/__\\";
            }
        }
        cout<<endl;
    }
	return 0;
}

暂无评论

登录 后即可评论。