谁能帮我下,会C语言的进!!!!!

来源:百度知道 编辑:UC知道 时间:2024/06/16 20:07:11
谁能帮我注释一下这个程序,谢谢了!!!!!!!!!!!!
#include<graphics.h>
#include<math.h>
#include<stdio.h>
#include<string.h>
#include<conio.h>
#define A 480
#define B 120
main()
{
char q;
int gdriver=VGA,gmode=VGAHI;
int i,cl=0,w=1;
float x,y,v1,v2,a1,a2,L,M,m,k,X,X0,F,F1,F2,g,c,s,G,G1,G2;
float sp=2;
initgraph(&gdriver,&gmode,"");

BG: cleardevice();
setcolor(5);
setbkcolor(0);
settextstyle(3,0,4);
outtextxy(80,50,"Single Pendulum Parameters Input");
setcolor(1);
rectangle(70,50,600,90);
setcolor(2);
rectangle(65,45,605,95);
setcolor(14);
rectangle(60,40,610,100);
setcolor(5);
moveto(100,100);
gotoxy(49,12);printf("");
settextstyle(1,0,2);
outtextxy(80,130,"PLEASE INPUT : ( 0<L<120 )");
setcolor(15);
line(50,160,620,160);
setco

settextstyle()函数,可以设定图形方式下输出文本字符这字体和大小但对于笔划型字体(除8*8点阵字以个的字体), 只能在水平和垂直方向以相同的放大倍数放大。

为此Turbo C2.0又提供了另外一个setusercharsize() 函数,对笔划字体可以分别设置水平
和垂直方向的放大倍数。该函数的调用格式为:

void far setusercharsize(int mulx, int divx, int muly, int divy); 该函数用来设置笔划型字和放大系数,它只有在settextstyle()函数中的charsize为0(或USER_CHAR_SIZE)时才起作用,并且字体为函数settextstyle()规定的字体。

调用函数setusercharsize()后,每个显示在屏幕上的字符都以其缺省大小乘以mulx/divx为输出字符宽,乘以muly/divy为输出字符高。

该函数的用法见下例。

#include<stdio.h>
#include<graphics.h>
int main()
{
int gdriver, gmode;
gdriver=DETECT;
initgraph(&gdriver, &gmode, "c:\\caic\\bgi");
setbkcolor(BLUE);
cleardevice();
setfillstyle(1, 2); /*设置填充方式*/
setcolor(WHITE); /*设置白色作图*/
rectangle(100, 100, 330, 380);
floodfill(50, 50, 14); /*填充方框以外的区域*/
setcolor(12); /*作图色为淡红*/
settextstyle(1, 0, 8); /*三重笔划字体,放大8倍*/
outtextxy(120, 120, "Very Good");