示例#1
0
//主函数部分=================================================
int main()
{
	srand(time(0));
	int x0,y0;
	char c;
	SPRD(2,0,33,0,15);
	SPRD(2,40,48,1,15);
    MAP();
	SCOR(scor);
	x=1;y=1;
	while(1)
	{
		gotoxy(x,y);
		x0=x;y0=y;
		printf("%d",scor%10);//光标字符
		if(y==y2&&x==x2){p=0;s=0;scor++;SCOR(scor);}
		BAIT();
		MOVE();
		BODR(x0,y0);
	}
	return 0;
}
示例#2
0
//主函数==============================================================================================
int main()
{
    p_in=∈
    p_out=&out;
    system("mode con cols=80 lines=22");
    CODE();//输入密码
    if(!shut)
    {
        Menu(4);//打印界面
        Menu(1);//打印选项
        Arrow();//打印光标
        gotoxy(0,0);
    }
    while(!shut)
    {
        while(!shut)
        {
            shut=0;
            MOVE();
            if(chos_in==1&&chos_out==1)
            {
                //转换进制并输出
                turn(p_in);
                turn(p_out);
                Trans(in,out);
                getch();
                //重置开关及界面等待下一次操作
                chos_in=chos_out=0;
                SPRD(3,13,50,15,19);
                Menu(1);
                break;
            }
        }
    }
    gotoxy(50,20);
    return 0;
}
示例#3
0
文件: Cpp1.cpp 项目: Unlockey/1stepp
int main()
{
	system("mode con cols=100 lines=32");
	srand(time(NULL));
	int A[10]={0},B[11];
	int x,y,i,b;//x为A下标,y为B下标,i用于记录数位,b用于存储当前插入数字,
//显示部分
	printf("随机抽取10个数字:");
	for(i=0;i<10;i++)
	{
		Sleep(100);
		A[i]=rand()%50;
		CLR(3);
		gotoxy(4*i,29);
		printf("%d ",A[i]);
		SPRD(2,4*i,4*i+1,28-A[i]/2,28);
	}
	CLR(3);
	Sleep(500);
	printf("\n\n");
//插入排序算法
	x=1;
	y=0;
	i=0;
	B[0]=A[0];
	while(i<10)
	{
		y=i;
		b=A[x];
		while(1)
		{
			if(B[y]>b)                //待插入数据较小时将组中数据后移
			{
				B[y+1]=B[y];
				if(y!=0)y--;
				else 
				{
					B[0]=b;
					x++;
					break;
				}
			}
			else 
			{
				B[y+1]=b;
				x++;
				break;
			}
		}
		i++;
	}
	printf("\n从小到大排序为:");
	for(i=0;i<10;i++)
	{
		Sleep(200);
		CLR(3);
		gotoxy(40+4*i,29);
		printf("%d ",B[i]);
		SPRD(1,40+4*i,40+4*i+1,28-B[i]/2,28);
	}
	printf("\n");
	getch();
	return 0;
}