码迷,mamicode.com
首页 > 其他好文 > 详细

oj---九度oj---1065

时间:2017-06-24 21:05:12      阅读:148      评论:0      收藏:0      [点我收藏+]

标签:style   return   九度oj   print   nbsp   code   turn   pre   scan   

 

 

#include<cstdio>
int main(){
    int h;
    scanf("%d",&h);
    int blanks;
    int num;
    for(int i=0;i<h;i++){
        num=h+i*2;
        blanks=(3*h-2)-2*i-h;
        while(blanks--) printf(" ");
        while(num--){
            printf("*");
            if(num==0)
                printf("\n");

        }
    }
    return 0;
}

 

oj---九度oj---1065

标签:style   return   九度oj   print   nbsp   code   turn   pre   scan   

原文地址:http://www.cnblogs.com/kprac/p/7074264.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!