|
发表于 2013-4-3 00:41:49
|
显示全部楼层
#include<stdio.h>
void main()
{
void touheng(x);
void weiheng(x);
void zhongjian1(x);
void zhongjian2(x);
void huihua(x,y);
int shu,heng;
printf("请输入行数:\n");
scanf("%d",&shu);
printf("请输入列数:\n");
scanf("%d",&heng);
while(heng>19)
{
printf("图会裂的,请输入一个小于等于19的正整数\n");
scanf("%d",&heng);
}
huihua(shu,heng);
}
void touheng(y)
{
int i;
printf("┌");
for(i=1;i<y;i++)
{
printf("─┬");
}
printf("─┐\n");
}
void weiheng(y)
{
int i;
printf("└");
for(i=1;i<y;i++)
{
printf("─┴");
}
printf("─┘\n");
}
void zhongjian1(y)
{
int i;
printf("│");
for(i=1;i<y;i++)
{
printf(" │");
}
printf(" │\n");
}
void zhongjian2(y)
{
int i;
printf("├");
for(i=1;i<y;i++)
{
printf("─┼");
}
printf("─┤\n");
}
void huihua(x,y)
{
int i;
touheng(y);
zhongjian1(y);
for (i=1;i<x;i++)
{
zhongjian2(y);
zhongjian1(y);
}
weiheng(y);
}
我很渣的。 |
|