HDU2052-Picture

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2052

#include<iostream>
#include<cstdio>
using namespace std;
int main(){
    int n,m;
    while(~scanf("%d%d",&n,&m)){
        for(int i=1;i<=m+2;i++){
            if(i==1||(i==(m+2))){
                printf("+");
                for(int j=1;j<=n;j++)
                    printf("-");
                printf("+");
            }
            else{
                printf("|");
                for(int j=1;j<=n;j++)
                    printf(" ");
                printf("|");
            }
            printf("\n");
        }
        printf("\n");
    }
return 0;
}

猜你喜欢

转载自blog.csdn.net/yimo_180227/article/details/81916669
今日推荐