可不可以帮我写一个8*8点阵显示0~9数字循环的C语言程序,要求每隔1s换一个数字,拜托拜托
2014-06-19
展开全部
#include<stdio.h>
#include<stdlib.h>
#include<windows.h>
void PrintNum(int n)
{
switch(n)
{
case 0:
printf("********\n");
printf("* *\n");
printf("* *\n");
printf("* *\n");
printf("* *\n");
printf("* *\n");
printf("* *\n");
printf("********\n");
break;
case 1:
printf(" *** \n");
printf(" * \n");
printf(" * \n");
printf(" * \n");
printf(" * \n");
printf(" * \n");
printf(" * \n");
printf(" ***** \n");
break;
case 2:
printf("********\n");
printf(" *\n");
printf(" *\n");
printf("********\n");
printf("* \n");
printf("* \n");
printf("* \n");
printf("********\n");
break;
case 3:
printf("********\n");
printf(" *\n");
printf(" *\n");
printf("********\n");
printf(" *\n");
printf(" *\n");
printf(" *\n");
printf("********\n");
break;
case 4:
printf(" **\n");
printf(" * *\n");
printf(" * *\n");
printf(" * *\n");
printf(" * *\n");
printf("********\n");
printf(" *\n");
printf(" *\n");
break;
case 5:
printf("********\n");
printf("* \n");
printf("* \n");
printf("********\n");
printf(" *\n");
printf(" *\n");
printf(" *\n");
printf("********\n");
break;
case 6:
printf("********\n");
printf("* \n");
printf("* \n");
printf("********\n");
printf("* *\n");
printf("* *\n");
printf("* *\n");
printf("********\n");
break;
case 7:
printf("********\n");
printf(" *\n");
printf(" *\n");
printf(" *\n");
printf(" *\n");
printf(" *\n");
printf(" *\n");
printf(" *\n");
break;
case 8:
printf("********\n");
printf("* *\n");
printf("* *\n");
printf("* *\n");
printf("********\n");
printf("* *\n");
printf("* *\n");
printf("********\n");
break;
case 9:
printf("********\n");
printf("* *\n");
printf("* *\n");
printf("* *\n");
printf("********\n");
printf(" *\n");
printf(" *\n");
printf("********\n");
break;
}
}
int main()
{
int i = 0;
while(1)
{
system("cls");
PrintNum(i);
i++;
if(i==10)i=0;
Sleep(1000);
}
return 0;
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2014-06-19
展开全部
就打印字符的问题,sleep一秒打一张不就行啦
追问
不懂啊,我需要的是C语言程序
追答
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询