⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 start.c

📁 这是过去自己编写的一个初级Dos程序
💻 C
字号:
/*start.c*/
#include <conio.h>
#include <graphics.h>
#include <math.h>
#define PI 3.1415926

void polygonc();
void block();

/*Logo*/
start()
{
	int i,j,a,length,n,theta,x=100,y=350;
	int gdriver=DETECT,gmode;
	length=270;n=20;theta=5;
	initgraph(&gdriver,&gmode,"c:\\tc");
	gotoxy(28,4);
	printf("Students Management System");
	gotoxy(31,6);
	printf("Version 2.23 Build 1");
	gotoxy(20,8);
	printf("Copyright (c) 2004 LIU Binbin. All Rights");
	gotoxy(48,16);
	printf("Author: LIU Binbin");
	gotoxy(48,18);
	printf("Don't hesitate to contact me!");
	gotoxy(48,20);
	printf("E-mail: lbb_jb325@doit.net.cn");
	gotoxy(48,22);
	printf("Tel: 85806696");
	setbkcolor(BLACK);
	setcolor(14);
	a=length/4;
	for (i=1;i<=4;i++)
	{
		for (j=1;j<=4;j++)
		{
			block(x,y,a,n,theta);
			theta=-theta;
			x+=a;
		}
		x=100;y-=a;theta=-theta;
	}
	getch();
	closegraph();
}

void polygonc(x0,y0,r,n,af)
int x0,y0,r,n;
float af;
{
	int x,y,xs,ys,i;
	float dtheta,theta;
	if (n<3) return;
	dtheta=2*PI/n;
	theta=af*PI/180;
	xs=x0+r*cos(theta);
	ys=y0+r*sin(theta);
	moveto(xs,ys);
	for (i=1;i<n;i++)
	{
		theta+=dtheta;
		x=x0+r*cos(theta);
		y=y0+r*sin(theta);
		lineto(x,y);
	}
	lineto(xs,ys);
}

void block(x,y,a,n,theta)
int x,y,a,n,theta;
{
	int x0,y0,i,r;
	float t,f,af=45.0;
	t=fabs(theta*PI/180);
	f=1.0/(cos(t)+sin(t));
	r=a/sqrt(2);
	x0=x+0.5*a;
	y0=y+0.5*a;
	for (i=1;i<=n;i++)
	{
		polygonc(x0,y0,r,4,af);
		r*=f;
		af-=theta;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -