0分求助!!!
查看原帖
0分求助!!!
373226
justinjia楼主2021/2/11 14:20

测试点信息

测试点编号状态
#1#5\#1-\#5WA\colorbox{red}{\color{white}WA}
源代码
#include"stdio.h"
#include"math.h"
void draw(int depth,int space_num,int repeat){
    if(depth==1){
        for(int i=0;i<repeat;i++){
            for(int j=0;j<space_num;j++)
                printf(" ");
            printf(" /\\ ");
            for(int j=0;j<space_num;j++)
                printf(" ");
        }
        printf("\n");
        for(int i=0;i<repeat;i++){
            for(int j=0;j<space_num;j++)
                printf(" ");
            printf("/__\\");
            for(int j=0;j<space_num;j++)
                printf(" ");
        }
        printf("\n");
    }else{
        draw(depth-1,space_num+pow(2,depth-1),repeat);
        draw(depth-1,space_num,repeat*2);
    }
}
int main(void){
    int n;
    scanf("%d",&n);
    draw(n,0,1);
    return 0;
}
2021/2/11 14:20
加载中...