﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>IT博客-悲惨的狼的门户-文章分类-基础</title><link>http://www.cnitblog.com/zhangjiang838/category/5277.html</link><description /><language>zh-cn</language><lastBuildDate>Sun, 02 Oct 2011 03:57:45 GMT</lastBuildDate><pubDate>Sun, 02 Oct 2011 03:57:45 GMT</pubDate><ttl>60</ttl><item><title>-个人成绩管理(图形菜单) </title><link>http://www.cnitblog.com/zhangjiang838/articles/26549.html</link><dc:creator>悲惨的狼</dc:creator><author>悲惨的狼</author><pubDate>Mon, 30 Apr 2007 19:18:00 GMT</pubDate><guid>http://www.cnitblog.com/zhangjiang838/articles/26549.html</guid><wfw:comment>http://www.cnitblog.com/zhangjiang838/comments/26549.html</wfw:comment><comments>http://www.cnitblog.com/zhangjiang838/articles/26549.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/zhangjiang838/comments/commentRss/26549.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/zhangjiang838/services/trackbacks/26549.html</trackback:ping><description><![CDATA[&lt;!--StartFragment--&gt;/****************************************/<br>/* TurboC 2.0下运行通过 */<br>/* 图形方式下菜单的应用(成绩管理) */<br>/* http://huaigong.myrice.com */<br>/****************************************/<br>#include&lt;graphics.h&gt;<br>#include&lt;stdlib.h&gt;<br>#include&lt;dos.h&gt;<br><br><br>#define TRUE 1<br>#define FALSE 0<br>#define KB_DOWN&nbsp; 80 /*......define key......*/<br>#define KB_UP&nbsp;&nbsp;&nbsp; 72<br>#define KB_HOME&nbsp; 71<br>#define KB_END&nbsp;&nbsp; 79<br>#define KB_ENTER 28<br>#define KB_I&nbsp;&nbsp;&nbsp;&nbsp; 23<br>#define KB_O&nbsp;&nbsp;&nbsp;&nbsp; 24<br>#define KB_V&nbsp;&nbsp;&nbsp;&nbsp; 47<br>#define KB_F&nbsp;&nbsp;&nbsp;&nbsp; 33<br>#define KB_Q&nbsp;&nbsp;&nbsp;&nbsp; 16<br><br>/*......DEFINE FUCTION......*/<br>int get_key();<br>int get_item(int,int);<br>void setmenuback();<br>void input();<br>void output();<br>void view();<br>void cartoon();<br>void form();<br>void *buf_curse;<br>static int num[4][2];<br><br>void cartoon()<br>{int height=0,width=0;<br>&nbsp; float i,j;<br>&nbsp; unsigned char *temp="THANKS.BYE!";<br>&nbsp; settextjustify(LEFT_TEXT,TOP_TEXT);<br>&nbsp; cleardevice();<br>&nbsp; for(i=1.0;i&lt;11.0;i+=0.2)<br>&nbsp;&nbsp;&nbsp;&nbsp; {setvisualpage(0);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setactivepage(1);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cleardevice();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ellipse(320,240,130,50,160,30);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(j=0;j&lt;=13;j++)<br>{setcolor(j/2==0?LIGHTBLUE:BLACK);<br>&nbsp; ellipse(320,240,0,360,100-8*j,100);<br>&nbsp; setcolor(LIGHTBLUE);<br>&nbsp; ellipse(320,240,0,360,100-8*j,100);<br>&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setcolor(10);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setbkcolor(BLACK);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; settextstyle(TRIPLEX_FONT,HORIZ_DIR,i);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; outtextxy((639-width)/2,240-height/2,temp);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setvisualpage(1);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setactivepage(0);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cleardevice();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ellipse(320,240,130,50,160,30);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(j=0;j&lt;=13;j++)<br>{setcolor(j/2==0?LIGHTBLUE:BLACK);<br>&nbsp; ellipse(320,240,0,360,100,100-8*j);<br>&nbsp; setcolor(LIGHTBLUE);<br>&nbsp; ellipse(320,240,0,360,100-8*j,100);<br>&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setcolor(11);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; settextstyle(TRIPLEX_FONT,HORIZ_DIR,i+=0.2);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; width=textwidth(temp);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; height=textheight(temp);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; outtextxy((639-width)/2,240-height/2,temp);}<br>}<br><br>main()<br>{<br>&nbsp; int driver,mode,flag=0;<br>&nbsp; int ad[640];<br>&nbsp; int row,item_num,i,done;<br>&nbsp; float da;<br>&nbsp; unsigned size;<br>&nbsp; for(i=0;i&lt;640;i++)<br>&nbsp;&nbsp;&nbsp; ad[i]=580/2;<br><br>&nbsp;&nbsp;&nbsp;&nbsp; /*......MENU......*/<br>&nbsp; while(!flag)<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; driver=VGA;<br>&nbsp;&nbsp;&nbsp; mode=VGAHI;<br>initgraph(&amp;driver,&amp;mode,"e:\\tc");<br>&nbsp;&nbsp;&nbsp; size=imagesize(0,0,90,22);<br>&nbsp;&nbsp;&nbsp; if(size!=1)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; buf_curse=malloc(size);<br>&nbsp;&nbsp;&nbsp; setfillstyle(1,12);<br>&nbsp;&nbsp;&nbsp; bar(0,0,93,22);<br>&nbsp;&nbsp;&nbsp; getimage(0,0,93,22,buf_curse);<br>&nbsp;&nbsp;&nbsp; setfillstyle(1,BLACK);<br>&nbsp;&nbsp;&nbsp; bar(0,0,94,23);<br>&nbsp;&nbsp;&nbsp; setmenuback();<br>&nbsp;&nbsp;&nbsp; item_num=5;<br>&nbsp;&nbsp;&nbsp; putimage(11,91,buf_curse,XOR_PUT);<br>&nbsp;&nbsp;&nbsp; setcolor(WHITE);<br>&nbsp;&nbsp;&nbsp; row=0;<br>&nbsp;&nbsp;&nbsp; done=FALSE;<br>&nbsp;&nbsp;&nbsp; do<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {row=get_item(row,item_num);<br>switch(row)<br>{<br>&nbsp;&nbsp; case 0:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /*......INPUT......*/<br>&nbsp;&nbsp;&nbsp;&nbsp; input();<br>&nbsp;&nbsp;&nbsp;&nbsp; break;<br>&nbsp;&nbsp; case 1:<br>&nbsp;&nbsp;&nbsp;&nbsp; output();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /*......OUTPUT......*/<br>&nbsp;&nbsp;&nbsp;&nbsp; break;<br>&nbsp;&nbsp; case 2:<br>&nbsp;&nbsp;&nbsp;&nbsp; view();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /*......VIEW......*/<br>&nbsp;&nbsp;&nbsp;&nbsp; break;<br>&nbsp;&nbsp; case 3:<br>&nbsp;&nbsp;&nbsp;&nbsp; form();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /*......FORM......*/<br>&nbsp;&nbsp;&nbsp;&nbsp; break;<br>&nbsp;&nbsp; case 4:<br>&nbsp;&nbsp;&nbsp;&nbsp; done=TRUE;<br>&nbsp;&nbsp;&nbsp;&nbsp; cartoon();<br>&nbsp;&nbsp;&nbsp;&nbsp; closegraph();<br>&nbsp;&nbsp;&nbsp;&nbsp; exit(0);<br>&nbsp; }<br>&nbsp; if(flag)<br>&nbsp;&nbsp;&nbsp; {flag=0;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>&nbsp;&nbsp;&nbsp; }<br>}while(!done);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>restorecrtmode();<br>&nbsp; }<br><br><br>void setmenuback()<br>{int k;<br>float l,m,n;<br>setcolor(YELLOW);<br>rectangle(0,0,639,479);<br>rectangle(0,457,639,479);<br>rectangle(0,0,116,479);<br>setfillstyle(1,LIGHTGRAY);<br>bar(1,458,638,478);<br>setcolor(BLACK);<br>outtextxy(150,466,"****** WELCOME TO USE THIS MENU ******");<br>setfillstyle(1,LIGHTBLUE);<br>setcolor(BLUE);<br>rectangle(10,35,104,69);<br>bar(11,36,104,68);<br>setcolor(YELLOW);<br>for(k=0;k&lt;5;k++)<br>&nbsp;&nbsp;&nbsp; {rectangle(10,90+k*25,104,115+k*25);<br>&nbsp;&nbsp;&nbsp;&nbsp; floodfill(10,90+k*25,YELLOW);<br>&nbsp;&nbsp;&nbsp;&nbsp; }<br>settextstyle(1,HORIZ_DIR,4);<br>setcolor(WHITE);<br>outtextxy(16,30,"MENU");<br>settextstyle(0,HORIZ_DIR,1);<br>setcolor(WHITE);<br>outtextxy(16,100," nput");<br>outtextxy(16,125," utput");<br>outtextxy(16,150," iew");<br>outtextxy(16,175," orm");<br>outtextxy(16,200," uit");<br>/*......HOT KEY......*/<br>setcolor(LIGHTRED);<br>outtextxy(16,100,"I");<br>outtextxy(16,125,"O");<br>outtextxy(16,150,"V");<br>outtextxy(16,175,"F");<br>outtextxy(16,200,"Q");<br>/*......TABLE LIGHT......*/<br>setfillstyle(1,WHITE);<br>setcolor(WHITE);<br>bar(10,437,104,439);<br>setfillstyle(1,DARKGRAY);<br>setcolor(DARKGRAY);<br>bar(40,431,66,437);<br>setcolor(WHITE);<br>for(l=0.0;l&lt;=7.0;l+=0.1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; circle(93,309,l);<br>setcolor(LIGHTGRAY);<br>for(m=0.0,n=0.0;m&lt;=4.0;m+=0.4,n+=0.08)&nbsp;&nbsp; line(16+n,365,51+m,431);<br>for(l=0.0;l&lt;=9.0;l+=0.3)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ellipse(16,364,0,360,l-4,l);<br>for(m=0.0,n=0.0;m&lt;=3.0;m+=0.3,n+=0.1)&nbsp;&nbsp;&nbsp; line(16+m,361,62+n,295);<br>for(l=0.0;l&lt;=2.0;l+=0.4)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; line(62,295+l,72,294);<br>for(m=0.0,n=0.0;m&lt;=9.0;m+=0.5,n+=0.05)&nbsp;&nbsp; line(67+m,292+n,73+m,298+n);<br>for(l=0.0;l&lt;=20.0;l+=0.1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ellipse(94,310,45,225,l,l);<br>}<br><br><br>/*......INPUT......*/<br>void input()<br>{int j;<br>&nbsp; setcolor(LIGHTRED);<br>&nbsp; setfillstyle(1,LIGHTBLUE);<br>&nbsp; bar(1,458,638,478);<br>&nbsp; outtextxy(5,467,"QING SHU RU NI DE 4 KE CHENG JI.");<br>&nbsp; setfillstyle(1,LIGHTBLUE);<br>&nbsp; setcolor(BLUE);<br>&nbsp; bar(190,160,530,230);<br>&nbsp; setfillstyle(1,LIGHTGREEN);<br>&nbsp; bar(190,178,530,212);<br>&nbsp; setcolor(BLACK);<br>&nbsp; outtextxy(192,195," QING SHU RU --YU WEN-- CHENG JI:");<br>&nbsp; for(j=0;j&lt;2;j++)<br>&nbsp;&nbsp;&nbsp;&nbsp; {num[0][j]=getch();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setcolor(RED);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; outtextxy(468+j*7,195,&amp;num[0][j]);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp; getch();<br>&nbsp; setfillstyle(1,LIGHTGREEN);<br>&nbsp; bar(190,178,530,212);<br>&nbsp; delay(5000);<br>&nbsp; setcolor(BLACK);<br>&nbsp; outtextxy(192,195,"QING SHU RU --SHU XUE-- CHENG JI:");<br>&nbsp; for(j=0;j&lt;2;j++)<br>&nbsp;&nbsp;&nbsp;&nbsp; {num[1][j]=getch();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setcolor(RED);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; outtextxy(468+j*7,195,&amp;num[1][j]);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp; getch();<br>&nbsp; setfillstyle(1,LIGHTGREEN);<br>&nbsp; bar(190,178,530,212);<br>&nbsp; delay(5000);<br>&nbsp; setcolor(BLACK);<br>&nbsp; outtextxy(192,195,"QING SHU RU --YING YU-- CHENG JI:");<br>&nbsp; for(j=0;j&lt;2;j++)<br>&nbsp;&nbsp;&nbsp;&nbsp; {num[2][j]=getch();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setcolor(RED);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; outtextxy(468+j*7,195,&amp;num[2][j]);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp; getch();<br>&nbsp; setfillstyle(1,LIGHTGREEN);<br>&nbsp; bar(190,178,530,212);<br>&nbsp; delay(5000);<br>&nbsp; setcolor(BLACK);<br>&nbsp; outtextxy(192,195,"&nbsp; QING SHU RU --WU LI-- CHENG JI:");<br>&nbsp; for(j=0;j&lt;2;j++)<br>&nbsp;&nbsp;&nbsp;&nbsp; {num[3][j]=getch();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setcolor(RED);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; outtextxy(468+j*7,195,&amp;num[3][j]);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp; getch();<br>&nbsp; setcolor(LIGHTRED);<br>&nbsp; setfillstyle(1,LIGHTBLUE);<br>&nbsp; bar(1,458,638,478);<br>&nbsp; outtextxy(5,467,"OK. INPUT SUCCESS,PRESS ANY KEY TO QUIT...");<br>&nbsp; getch();<br>&nbsp; delay(2000);<br>&nbsp; setfillstyle(1,BLACK);<br>&nbsp; bar(190,160,530,230);<br>&nbsp; setfillstyle(1,LIGHTGRAY);<br>&nbsp; bar(1,458,643,478);<br>&nbsp; }<br><br>void output()<br>{int i;<br>&nbsp; float m,n;<br>&nbsp; setcolor(WHITE);<br>&nbsp; for(m=0.0,n=0.0;m&lt;=100.0;m+=0.1,n+=0.3)<br>&nbsp;&nbsp;&nbsp;&nbsp; line(280-m,85+n,520-m,85+n);<br>&nbsp; for(m=0.0;m&lt;=39.0;m+=0.1)<br>&nbsp;&nbsp;&nbsp;&nbsp; line(435+m,340,420,385);<br>&nbsp; setcolor(BLACK);<br>&nbsp; line(520,85,420,385);<br>&nbsp; outtextxy(318,110,"---CHENG JI DAN---");<br>&nbsp; outtextxy(305,146,"XING MING :&nbsp;&nbsp; YOU");<br>&nbsp; outtextxy(283,200,"--YU WEN-- : ");<br>&nbsp; setcolor(RED);<br>&nbsp; for(i=0;i&lt;2;i++)<br>&nbsp;&nbsp;&nbsp;&nbsp; outtextxy(400+i*7,200,&amp;num[0][i]);<br>&nbsp; setcolor(BLACK);<br>&nbsp; outtextxy(274,227,"--SHU XUE--: ");<br>&nbsp; setcolor(RED);<br>&nbsp; for(i=0;i&lt;2;i++)<br>&nbsp;&nbsp;&nbsp;&nbsp; outtextxy(391+i*7,227,&amp;num[1][i]);<br>&nbsp; setcolor(BLACK);<br>&nbsp; outtextxy(265,254,"--YING YU--: ");<br>&nbsp; setcolor(RED);<br>&nbsp; for(i=0;i&lt;2;i++)<br>&nbsp;&nbsp;&nbsp;&nbsp; outtextxy(382+i*7,254,&amp;num[2][i]);<br>&nbsp; setcolor(BLACK);<br>&nbsp; outtextxy(256,281,"--WU LI--&nbsp; : ");<br>&nbsp; setcolor(RED);<br>&nbsp; for(i=0;i&lt;2;i++)<br>&nbsp;&nbsp;&nbsp;&nbsp; outtextxy(373+i*7,281,&amp;num[3][i]);<br>&nbsp; setcolor(BLACK);<br>&nbsp; outtextxy(330,352,"2000:7:11");<br>&nbsp; setcolor(YELLOW);<br>&nbsp; for(m=0.0,n=0.0;m&lt;=20.0;m+=0.1,n+=0.07)<br>&nbsp;&nbsp;&nbsp;&nbsp; ellipse(240,348,0,360,m-1,n);<br>&nbsp; setcolor(BROWN);<br>&nbsp; for(m=0.0,n=0.0;m&lt;=12.0;m+=0.1,n+=0.07)<br>&nbsp;&nbsp;&nbsp;&nbsp; ellipse(240,348,0,360,m-1,n);<br>&nbsp; setcolor(LIGHTMAGENTA);<br>&nbsp; for(n=0.0;n&lt;=10.0;n+=0.03)<br>&nbsp;&nbsp;&nbsp;&nbsp; line(236+n,350,236+n,390);<br>&nbsp; setcolor(BLACK);<br>&nbsp; for(m=0.0;m&lt;=10.0;m+=0.01)<br>&nbsp;&nbsp;&nbsp;&nbsp; line(241,383,236+m,390);<br>&nbsp; getch();<br>&nbsp; setcolor(LIGHTRED);<br>&nbsp; setfillstyle(1,LIGHTBLUE);<br>&nbsp; bar(1,458,638,478);<br>&nbsp; outtextxy(5,467," PRESS ANY KEY TO QUIT...");<br>&nbsp; getch();<br>&nbsp; delay(2000);<br>&nbsp; setfillstyle(1,BLACK);<br>&nbsp; bar(150,50,600,400);<br>&nbsp; setfillstyle(1,LIGHTGRAY);<br>&nbsp; bar(1,458,643,478);<br>&nbsp; }<br><br>&nbsp; void view()<br>&nbsp; {int j;<br>&nbsp;&nbsp; setfillstyle(1,LIGHTBLUE);<br>&nbsp;&nbsp; setcolor(LIGHTRED);<br>&nbsp;&nbsp; bar(190,160,530,230);<br>&nbsp;&nbsp; bar(1,458,638,478);<br>&nbsp;&nbsp; setfillstyle(1,LIGHTGREEN);<br>&nbsp;&nbsp; bar(190,178,530,212);<br>&nbsp;&nbsp; outtextxy(5,467,"NOW, NI ZHENG ZAI AN SHUN XU GUAN KAN GE KE CHENG JI.");<br>&nbsp;&nbsp; setcolor(BLACK);<br>&nbsp;&nbsp; outtextxy(195,195,"&nbsp;&nbsp; *PRESS ANY KEY TO START...");<br>&nbsp;&nbsp; getch();<br>&nbsp;&nbsp; bar(190,178,530,212);<br>&nbsp;&nbsp; setcolor(BLACK);<br>&nbsp;&nbsp; outtextxy(195,195,"*NI DE --YU WEN-- CHENG JI WEI:");<br>&nbsp;&nbsp; setcolor(RED);<br>&nbsp;&nbsp; for(j=0;j&lt;2;j++)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; outtextxy(470+j*7,195,&amp;num[0][j]);<br>&nbsp;&nbsp; delay(100000);<br>&nbsp;&nbsp; bar(190,178,530,212);<br>&nbsp;&nbsp; setcolor(BLACK);<br>&nbsp;&nbsp; outtextxy(195,195,"*NI DE --SHU XUE-- CHENG JI WEI:");<br>&nbsp;&nbsp; setcolor(RED);<br>&nbsp;&nbsp; for(j=0;j&lt;2;j++)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; outtextxy(470+j*7,195,&amp;num[1][j]);<br>&nbsp;&nbsp; delay(100000);<br>&nbsp;&nbsp; bar(190,178,530,212);<br>&nbsp;&nbsp; setcolor(BLACK);<br>&nbsp;&nbsp; outtextxy(195,195,"*NI DE --YING YU-- CHENG JI WEI:");<br>&nbsp;&nbsp; setcolor(RED);<br>&nbsp;&nbsp; for(j=0;j&lt;2;j++)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; outtextxy(470+j*7,195,&amp;num[2][j]);<br>&nbsp;&nbsp; delay(100000);<br>&nbsp;&nbsp; bar(190,178,530,212);<br>&nbsp;&nbsp; setcolor(BLACK);<br>&nbsp;&nbsp; outtextxy(195,195,"*NI DE --WU LI-- CHENG JI WEI:");<br>&nbsp;&nbsp; setcolor(RED);<br>&nbsp;&nbsp; for(j=0;j&lt;2;j++)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; outtextxy(470+j*7,195,&amp;num[3][j]);<br>&nbsp;&nbsp; delay(100000);<br>&nbsp;&nbsp; bar(190,178,530,212);<br>&nbsp;&nbsp; outtextxy(192,195,"PRESS ANY KEY TO QUIT");<br>&nbsp;&nbsp; getch();<br>&nbsp;&nbsp; setfillstyle(1,BLACK);<br>&nbsp;&nbsp; bar(150,30,550,400);<br>}<br><br><br><br>void form()<br>{int i;<br>&nbsp; setfillstyle(1,BLUE);<br>&nbsp; bar(1,458,638,478);<br>&nbsp; setcolor(YELLOW);<br>&nbsp; line(170,420,540,420);<br>&nbsp; line(170,60,170,420);<br>&nbsp; setcolor(WHITE);<br>&nbsp; settextstyle(1,0,1);<br>&nbsp; outtextxy(560,415,"KE MU");<br>&nbsp; settextstyle(0,0,1);<br>&nbsp; outtextxy(200,422,"YU WEN");<br>&nbsp; outtextxy(285,422,"SHU XUE");<br>&nbsp; outtextxy(370,422,"YING YU");<br>&nbsp; outtextxy(455,422," WU LI");<br>&nbsp; settextstyle(1,1,1);<br>&nbsp; outtextxy(150,80,"CHENG JI");<br>&nbsp; setfillstyle(1,LIGHTRED);<br>&nbsp; bar(210,420-num[0][0]*4,240,420);<br>&nbsp; setfillstyle(1,CYAN);<br>&nbsp; bar(295,420-num[1][0]*4,325,420);<br>&nbsp; setfillstyle(1,BLUE);<br>&nbsp; bar(380,420-num[2][0]*4,410,420);<br>&nbsp; setfillstyle(1,GREEN);<br>&nbsp; bar(465,420-num[3][0]*4,495,420);<br>&nbsp; settextstyle(0,0,1);<br>&nbsp; for(i=0;i&lt;2;i++)<br>&nbsp;&nbsp;&nbsp;&nbsp; outtextxy(215+i*7,420-num[0][0]*4-10,&amp;num[0][i]);<br>&nbsp; for(i=0;i&lt;2;i++)<br>&nbsp;&nbsp;&nbsp;&nbsp; outtextxy(300+i*7,420-num[1][0]*4-10,&amp;num[1][i]);<br>&nbsp; for(i=0;i&lt;2;i++)<br>&nbsp;&nbsp;&nbsp;&nbsp; outtextxy(385+i*7,420-num[2][0]*4-10,&amp;num[2][i]);<br>&nbsp; for(i=0;i&lt;2;i++)<br>&nbsp;&nbsp;&nbsp;&nbsp; outtextxy(470+i*7,420-num[3][0]*4-10,&amp;num[3][i]);<br>&nbsp; setfillstyle(1,BLUE);<br>&nbsp; getch();<br>&nbsp; setcolor(LIGHTRED);<br>&nbsp; outtextxy(15,466,"PRESS ANY KEY TO QUIT...");<br>&nbsp; getch();<br>&nbsp; bar(1,458,638,478);<br>&nbsp; setfillstyle(1,BLACK);<br>&nbsp; bar(150,50,635,450);<br>&nbsp; }<br><br><br>int get_item(int row,int item_num)<br>{<br>int key,done;<br>done=FALSE;<br>do<br>&nbsp; {<br>&nbsp;&nbsp; key=get_key();<br>&nbsp;&nbsp; switch(key)<br>&nbsp;&nbsp;&nbsp; { case KB_DOWN:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; putimage(11,91+row*25,buf_curse,XOR_PUT);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(row==item_num-1)<br>&nbsp;&nbsp; row=0;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp; row+=1;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; putimage(11,91+row*25,buf_curse,XOR_PUT);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; break;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case KB_UP:<br>putimage(11,91+row*25,buf_curse,XOR_PUT);<br>if(row==0)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; row=item_num-1;<br>else<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; row-=1;<br>putimage(11,91+row*25,buf_curse,XOR_PUT);<br>break;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case KB_ENTER:<br>done=TRUE;<br>break;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case KB_HOME:<br>if(row!=0);<br>&nbsp; { putimage(11,91+row*25,buf_curse,XOR_PUT);<br>&nbsp;&nbsp;&nbsp; row=0;<br>&nbsp;&nbsp;&nbsp; putimage(11,91+row*25,buf_curse,XOR_PUT);<br>&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case KB_END:<br>if(row!=item_num-1)<br>&nbsp; { putimage(11,91+row*25,buf_curse,XOR_PUT);<br>&nbsp;&nbsp;&nbsp; row=item_num-1;<br>&nbsp;&nbsp;&nbsp; putimage(11,91+row*25,buf_curse,XOR_PUT);<br>&nbsp; }<br>&nbsp; break;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case KB_I:<br>if(row!=0)<br>{ putimage(11,91+row*25,buf_curse,XOR_PUT);<br>&nbsp;&nbsp; row=0;<br>&nbsp;&nbsp; putimage(11,91+row*25,buf_curse,XOR_PUT);<br>}<br>done=TRUE;<br>break;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case KB_O:<br>if(row!=1)<br>&nbsp; { putimage(11,91+row*25,buf_curse,XOR_PUT);<br>&nbsp;&nbsp;&nbsp; row=1;<br>&nbsp;&nbsp;&nbsp; putimage(11,91+row*25,buf_curse,XOR_PUT);<br>&nbsp; }<br>&nbsp; done=TRUE;<br>&nbsp; break;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case KB_V:<br>if(row!=2)<br>&nbsp; { putimage(11,91+row*25,buf_curse,XOR_PUT);<br>&nbsp;&nbsp;&nbsp; row=2;<br>&nbsp;&nbsp;&nbsp; putimage(11,91+row*25,buf_curse,XOR_PUT);<br>&nbsp; }<br>&nbsp; done=TRUE;<br>&nbsp; break;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case KB_F:<br>if(row!=3)<br>&nbsp; { putimage(11,91+row*25,buf_curse,XOR_PUT);<br>&nbsp;&nbsp;&nbsp; row=3;<br>&nbsp;&nbsp;&nbsp; putimage(11,91+row*25,buf_curse,XOR_PUT);<br>&nbsp;&nbsp; }<br>&nbsp;&nbsp; done=TRUE;<br>&nbsp;&nbsp; break;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; case KB_Q:<br>if(row!=4)<br>{ putimage(11,91+row*25,buf_curse,XOR_PUT);<br>&nbsp;&nbsp; row=4;<br>&nbsp;&nbsp; putimage(11,91+row*25,buf_curse,XOR_PUT);<br>}<br>done=TRUE;<br>break;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; defaule:break;<br>}<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }while(!done);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return row;<br>}<br><br>int get_key()<br>{<br>&nbsp;&nbsp; union REGS rg;<br>&nbsp;&nbsp; rg.h.ah=0;<br>&nbsp;&nbsp; int86(0x16,&amp;rg,&amp;rg);<br>&nbsp;&nbsp; return rg.h.ah;<br>}<br>int show(int ch,int n)<br>{ int a;<br>&nbsp;&nbsp; a=(int)(10*(ch/2+1)*sin(2*3.14*n*(ch/2+2)/630));<br>&nbsp;&nbsp; return a;<br>}<br>
<img src ="http://www.cnitblog.com/zhangjiang838/aggbug/26549.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/zhangjiang838/" target="_blank">悲惨的狼</a> 2007-05-01 03:18 <a href="http://www.cnitblog.com/zhangjiang838/articles/26549.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>飞机定票系统</title><link>http://www.cnitblog.com/zhangjiang838/articles/26548.html</link><dc:creator>悲惨的狼</dc:creator><author>悲惨的狼</author><pubDate>Mon, 30 Apr 2007 19:16:00 GMT</pubDate><guid>http://www.cnitblog.com/zhangjiang838/articles/26548.html</guid><wfw:comment>http://www.cnitblog.com/zhangjiang838/comments/26548.html</wfw:comment><comments>http://www.cnitblog.com/zhangjiang838/articles/26548.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/zhangjiang838/comments/commentRss/26548.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/zhangjiang838/services/trackbacks/26548.html</trackback:ping><description><![CDATA[<xmp>/********************************/
/*	TurboC2.0运行通过	*/
/*	飞机订票系统		*/
/*  http://huaigong.myrice.com	*/
/********************************/
#include<stdlib.h>
#include<conio.h>
#include<stdio.h>
main()
{
char ch;
int flag=0;
menu();
do
{flag=1;
if((ch=getchar())!='\n')
{
switch(ch)
{
case '1':printf("\n\tDisplay Plane Information\n") ;
break;
case '2':printf("\n\tInput Plane Information\n") ;
break;
case '3':printf("\n\tQuery\n");
break;
case '4':printf("\n\tBooking\n");
break;
case '5':printf("\n\tReturn\n");
break;
case '\n':break;
case '0':exit(0);
default:printf("\n\tInput error!\n");
}
printf("\n\tpress any key ,again...\n");
getch();
menu();
}
}while(flag==1);
getch();
}
menu()
{  clrscr();
printf("\n\n\n\tPlane Booking System\n");
printf("\n\t1.Browse \n");
printf("\t2.Input \n");
printf("\t3.Query\n");
printf("\t4.Booking\n");
printf("\t5.Return Tickets\n");
printf("\t0.quit\n");
printf("\tpress a key for your choice:");
}
</xmp>
<img src ="http://www.cnitblog.com/zhangjiang838/aggbug/26548.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/zhangjiang838/" target="_blank">悲惨的狼</a> 2007-05-01 03:16 <a href="http://www.cnitblog.com/zhangjiang838/articles/26548.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>和学生管理有关的程序</title><link>http://www.cnitblog.com/zhangjiang838/articles/26547.html</link><dc:creator>悲惨的狼</dc:creator><author>悲惨的狼</author><pubDate>Mon, 30 Apr 2007 19:15:00 GMT</pubDate><guid>http://www.cnitblog.com/zhangjiang838/articles/26547.html</guid><wfw:comment>http://www.cnitblog.com/zhangjiang838/comments/26547.html</wfw:comment><comments>http://www.cnitblog.com/zhangjiang838/articles/26547.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/zhangjiang838/comments/commentRss/26547.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/zhangjiang838/services/trackbacks/26547.html</trackback:ping><description><![CDATA[<xmp>/***********************************/
/*	Turbo C2.0下运行通过	   */
/*	一个和学生管理有关的程序   */
/*	http://huaigong.myrice.com */
/***********************************/
#include<graphics.h>
#include
<process.h>
#include<stdlib.h>
#include<alloc.h>
#include<ctype.h>
#include<math.h>
#include<stdio.h>
#include<dos.h>
#include<stdlib.h>
#define TRUE 1
#define FALSE 0
#define KB_LEFT  75
#define KB_RIGHT 77
#define KB_ENTER 28
#define KB_Q     16
#define pi 3.1415926
#define COLOR1 WHITE
#define COLOR2 YELLOW
int MaxColor;
int n=0;
int get_key();
int choice(int x,int y);
int get_item(int,int);
int adin(int ch,int n);
void *gb;
void kitty()
{ int gdriver=VGA,gmode=VGAHI;
int i,j,x[40],y[40];
initgraph(&gdriver,&gmode,"e:\\tc");
cleardevice();
setcolor(3);
setfillstyle(LTBKSLASH_FILL,3);
ellipse(350,270,0,360,240,160);
floodfill(350,270,3);
setcolor(14);
moveto(420,310);
lineto(300,450);
lineto(540,450);
lineto(420,310);
setfillstyle(SOLID_FILL,14);
floodfill(420,380,14);
setcolor(RED);
circle(420,250,120);
setfillstyle(SOLID_FILL,WHITE);
floodfill(420,250,RED);
setcolor(BLACK);
circle(350,240,10);
circle(490,240,10);
setfillstyle(SOLID_FILL,BLACK);
floodfill(350,240,BLACK);
floodfill(490,240,BLACK);
setcolor(12);
circle(340,270,14);
circle(500,270,14);
setfillstyle(BKSLASH_FILL,4);
floodfill(340,260,12);
floodfill(500,260,12);
setcolor(BLACK);
setfillstyle(SOLID_FILL,RED);
fillellipse(410,130,50,80);
fillellipse(510,150,50,80);
setcolor(0);
circle(505,150,35);
circle(415,130,35);
setfillstyle(SOLID_FILL,BLACK);
floodfill(505,150,0);
floodfill(415,130,0);
setcolor(6);
circle(460,140,30);
setfillstyle(SOLID_FILL,0);
floodfill(460,140,6);
setcolor(4);
arc(420,300,225,315,20);
ellipse(420,321,170,365,6,10);
setfillstyle(SOLID_FILL,4);
floodfill(420,330,4);
circle(200,60,40);
circle(162,88,40);
circle(238,88,40);
circle(176,132,40);
circle(224,132,40);
circle(100,170,30);
circle(129,191,30);
circle(71,191,30);
circle(82,224,30);
circle(118,224,30);
circle(100,200,6);
setfillstyle(SOLID_FILL,14);
floodfill(200,60,4);
floodfill(162,88,4);
floodfill(238,88,4);
floodfill(176,132,4);
floodfill(224,132,4);
setfillstyle(SOLID_FILL,5);
floodfill(100,170,4);
floodfill(129,191,4);
floodfill(71,191,4);
floodfill(82,224,4);
floodfill(118,224,4);
setcolor(0);
circle(200,100,10);
setfillstyle(SOLID_FILL,15);
floodfill(200,100,0);
setcolor(7);
ellipse(330,380,0,360,50,15);
ellipse(510,380,0,360,50,15);
setfillstyle(SOLID_FILL,12);
floodfill(330,380,7);
floodfill(510,380,7);
setcolor(8);
circle(270,380,20);
circle(570,380,20);
setfillstyle(SOLID_FILL,15);
floodfill(270,380,8);
floodfill(570,380,8);
setcolor(3);
circle(360,459,20);
circle(480,459,20);
setfillstyle(SOLID_FILL,15);
floodfill(360,451,3);
floodfill(480,451,3);
settextjustify(0,2);
settextstyle(4,0,3);
setcolor(14);
for(i=0;i<30;i++)
y[i]=15*i+10;
for(j=0;j<30;j++)
{arc(10,y[j],0,180,5);
arc(20,y[j],0,180,5);
ellipse(15,y[j],180,360,10,15);
arc(620,y[j],0,180,5);
arc(610,y[j],0,180,5);
ellipse(615,y[j],180,360,10,15);delay(2000);
}
for(i=0;i<=30;i++)
x[i]=20*i+15;
for(j=0;j<=30;j++)
{arc(x[j]-5,10,0,180,5);
arc(x[j]+5,10,0,180,5);
ellipse(x[j],10,180,360,10,15);
arc(x[j]-5,445,0,180,5);
arc(x[j]+5,445,0,180,5);
ellipse(x[j],445,180,360,10,15);delay(2000);
}
setcolor(12); settextstyle(0,0,3);
outtextxy(200,20,"Hi,this a wondful place!");
delay(15000);
setcolor(13);
outtextxy(60,380,"You are welcome");
getch();
closegraph() ;
}
void goodbyer(void)
{ int gdriver=VGA,gmode=VGAHI;
long t;
struct palettetype pt;
int x,c=COLOR1;int k;int i,j;
unsigned size;void *buf,*bike;
initgraph(&gdriver,&gmode,"e:\\tc");
cleardevice();        setbkcolor(9);
setcolor(14);
setfillstyle(SOLID_FILL,14);
moveto(160,40);     lineto(163,47);
lineto(170,47); lineto(164,51);
lineto(166,58);lineto(160,54);   lineto(154,58);
lineto(155,51);  lineto(150,47);   lineto(157,47);
lineto(160,40);
floodfill(160,43,14);
size=imagesize(160,40,166,60);buf=malloc(size);
if(buf) getimage(160,40,166,60,buf);
cleardevice();
setcolor(12);
setlinestyle(0,0,3);
circle(530,390,60);
moveto(530,330);
lineto(540,315);
ellipse(542,305,0,360,20,6);
circle(327,350,100);
moveto(327,350);lineto(530,390);
arc(327,350,45,115,105);
moveto(335,246);lineto(342,216);
moveto(314,209);
lineto(370,215);
moveto(449,375);
lineto(440,402);
ellipse(440,409,0,360,15,5);
for(i=0;i<=12;i++)
{
moveto(327,350);
lineto(cos(i*pi/6)*100+327,350-sin(i*pi/6)*100);
}
for(i=0;i<=12;i++)
{moveto(530,390);
lineto(cos(i*pi/6)*60+530,390-sin(i*pi/6)*60);
}
bike=malloc(imagesize(200,180,630,460));
if(bike) getimage(200,180,630,460,bike);
/*  for(;!kbhit();)
for(x=200;x>=20;x-=50)
{
putimage(x,180,bike,XOR_PUT);
delay(500);
putimage(x-50,180,bike,COPY_PUT);
}*/
setcolor(7);
setfillstyle(SOLID_FILL,7);
arc(100,100,173,277,50);
arc(80,120,140,310,40);
floodfill(46,140,7);
for(;!kbhit();)
for(x=50;x<=600;x+=30)
{
putimage(x+9,40,buf,COPY_PUT);
delay(1500);
putimage(x+9,40,buf,XOR_PUT);  }
for(x=200;x>=20;x-=50)
{
putimage(x,180,bike,XOR_PUT);
delay(1000);
putimage(x-50,180,bike,COPY_PUT);
}
delay(10000);
gettime(&t);
srand(t);
MaxColor=getmaxcolor();
getpalette(&pt);
settextjustify(CENTER_TEXT,CENTER_TEXT);
show_char();
for(i=0;i<640;i+=10)
{ setfillstyle(1,c=c==COLOR2?COLOR1:COLOR2);
bar(i,100,i+10,110);
}
for(i=110;i<300;i+=10)
{setfillstyle(1,c=c==COLOR2?COLOR1:COLOR2);
bar(i,100,i+10,110);
}
for(i=630;i>=0;i-=10)
{setfillstyle(1,COLOR2?COLOR1:COLOR2);
bar(i,300,i+10,310 ) ;
}
for(i=290;i>100;i-=10)
{setfillstyle(1,c=c==COLOR2?COLOR1:COLOR2);
bar(0,i,10,i+10);
}
setfillstyle(SOLID_FILL,0);
for(;!kbhit();)
{show_char() ;
for(k=0;k<8;k++)
{setpalette(COLOR1,k&1?pt.colors[COLOR1]:pt.colors[COLOR2]);
setpalette(COLOR2,k&1?pt.colors[COLOR2]:pt.colors[COLOR1]);
if(k<8) for(i=1;i++<30000;) for(j=1;j++<2;) ;
}
}
getch();
getch();
closegraph();
}
show_char()
{static int font=0;
int c=random(MaxColor+1);
static font_size[]={7,10,20,10,10,10};
if(c!=BLACK) setcolor(c);
else setcolor(random(MaxColor+1));
bar(10,110,630,300);
settextstyle(font,HORIZ_DIR,font_size[font]);
setfillstyle(1,11);
fillellipse(315,185,175,55);
outtextxy(310,200,"Good");delay(10000);
setfillstyle(1,14);
fillellipse(315,185,175,55);
setcolor(5);   outtextxy(310,200,"Bye"); delay(10000);
setfillstyle(1,10);fillellipse(315,185,175,55);
setcolor(13);outtextxy(310,200,"See"); delay(10000);
setfillstyle(1,12); fillellipse(315,185,175,55); setcolor(14);
outtextxy(310,200,"You");
settextstyle(1,0,5);
setcolor(5);
outtextxy(100,260,"T");delay(1500);
outtextxy(130,260,"h");delay(1500);
outtextxy(160,260,"a");delay(1500);
outtextxy(190,260,"n"); delay(1500);
outtextxy(220,260,"k");delay(1500);
outtextxy(250,260,"s");delay(1500);
outtextxy(290,260,"V");delay(1500);
outtextxy(320,260,"e");delay(1500);
outtextxy(350,260,"r");delay(1500);
outtextxy(380,260,"y");delay(1500);
outtextxy(420,260,"M");delay(1500);
outtextxy(450,260,"u");delay(1500);
outtextxy(480,260,"c");delay(1500);
outtextxy(510,260,"h");delay(1500);
setcolor(14);
arc(60,270,60,120,10);arc(530,270,60,120,10); delay(10000);
arc(80,270,60,120,10);arc(550,270,60,120,10); delay(10000);
arc(70,272,240,300,10); arc(540,272,240,300,10);
font=(font+1)%5;
}
main()
{
int driver=VGA,mode=VGAHI,flag=0;
int ad[640];
int row,item_num,i,ch,y,n,data,done,k;
float da;
unsigned size;
kitty();
for(i=0;i<640;i++)
ad[i]=580/2;
while(!flag)
{
driver=VGA;
mode=VGAHI;
initgraph(&driver,&mode,"e:\\tc\\");
setcolor(YELLOW);
setfillstyle(1,YELLOW);
fillellipse(51,50,50,20);
size=imagesize(1,10,101,70);
if(size!=1)
gb=malloc(size);
setfillstyle(1,YELLOW);
fillellipse(51,50,50,20);
getimage(1,10,101,70,gb);
setcolor(YELLOW);
rectangle(0,0,639,479);
rectangle(0,457,639,479);
setfillstyle(1,LIGHTBLUE);
bar(1,458,638,478);
setcolor(BLUE);
outtextxy(90,467," his is a wonderful place!     welcome!! ");
setcolor(RED);
outtextxy(90,467,"T");
setcolor(LIGHTGREEN);
line(1,5,639,5);
line(1,1,1,50);
line(639,1,639,30);
setcolor(LIGHTRED);
line(1,73,639,73);
line(1,76,639,76);
setfillstyle(1,BLACK);
/*setcolor(BLUE);
rectangle(2,2,634,40);*/
/* bar(2,2,637,39);*/
item_num=6;
setcolor(LIGHTGREEN);
for(k=0;k<item_num;k++)
{ ellipse(51+107*k,50,0,360,50,20);
floodfill(2,42,LIGHTGREEN);
}
settextstyle(1,HORIZ_DIR,4);
setcolor(LIGHTGREEN);
outtextxy(200,1,"how do you do !");
settextstyle(0,HORIZ_DIR,1);
setcolor(WHITE);
outtextxy(40,50," rite");
outtextxy(150,50," ist");
outtextxy(245,50," ort");
outtextxy(358,50," ictr");
outtextxy(460,50," aker");
outtextxy(570,50," uit");
setcolor(LIGHTRED);
outtextxy(22,50,"(W)");
outtextxy(132,50,"(L)");
outtextxy(228,50,"(S)");
outtextxy(340,50,"(P)");
outtextxy(442,50,"(M)");
outtextxy(552,50,"(Q)");
/* putimage(1,10,gb,XOR_PUT);*/
/* setcolor(WHITE);*/
row=0;
done=FALSE;
do
{
row=get_item(row,item_num);
switch(row)
{
case 0:
setfillstyle(1,BLACK);
bar(2,77,638,455);
shuru();break;
case 1:
setfillstyle(1,BLACK);
bar(2,77,638,455);
shuchu();break;
case 2:
setfillstyle(1,LIGHTGREEN);
bar(2,77,638,455);
sort();break;
case 3:
setfillstyle(1,BLACK);
bar(2,77,638,455);
pic();break;
case 4:
setfillstyle(1,LIGHTBLUE);
bar(2,77,638,455);
maker();break;
case 5:
done=TRUE;
goodbyer();
delay(50000);
closegraph();
exit(0);
}
if(flag)
{flag=0;break;}
}while(!done);
}
restorecrtmode();
}
int get_item(int row,int item_num)
{
int key,done;
done=FALSE;
do
{
key=get_key();
switch(key)
{ case KB_ENTER:
done=TRUE;break;
case KB_RIGHT:
putimage(1+row*107,10,gb,XOR_PUT);
if(row==item_num-1) row=0;
else row+=1;
putimage(1+row*107,10,gb,XOR_PUT);
break;
case KB_LEFT:
putimage(1+row*107,10,gb,XOR_PUT);
if(row==0) row=item_num-1;
else row-=1;
putimage(1+row*107,10,gb,XOR_PUT);
break;
case KB_Q:
if(row!=5)
{ putimage(1+row*107,10,gb,XOR_PUT);
row=5;
putimage(1+row*107,10,gb,XOR_PUT);}
done=TRUE;break;
default:break;
}
}while(!done);
return row;
}
int get_key()
{
union REGS rg;
rg.h.ah=0;
int86(0x16,&rg,&rg);
return rg.h.ah;
}
int show(int ch,int n)
{ int a;
a=(int)(10*(ch/2+1)*sin(2*3.14*n*(ch/2+2)/630));
return a;
}
maker()
{settextstyle(1,HORIZ_DIR,4);
setcolor(LIGHTGREEN);
line(320,75,1,250);
line(1,250,320,455);
line(320,455,639,250);
line(639,250,320,75);
/* ellipse(320,250,0,360,300,100);*/
setcolor(YELLOW);
outtextxy(150,180,"Maker : CHEN JUNYU");
delay(30000);
setcolor(5);
outtextxy(220,240,"Class  : 99.5");
delay(30000);
setcolor(15);
outtextxy(181,300,"Data  : 2000-7-10");
arc(50,140,60,120,30);
arc(100,140,60,120,30);
arc(75,120,240,300,40);
setcolor(LIGHTRED);
settextstyle(0,0,2);
outtextxy(20,330,"please  ");
outtextxy(20,365,"give me");
outtextxy(20,400,"high marks!");
delay(10000);
setcolor(15);
arc(590,80,240,300,30);
arc(540,80,240,300,30);
arc(565,180,60,120,30);
setcolor(14);
outtextxy(540,330,"please");
outtextxy(510,365,"do not");
outtextxy(450,400,"make me cry!");
}
help()
{settextstyle(1,HORIZ_DIR,8);
outtextxy(150,240,"HELP");}
struct student
{char num[8];
char name[20];
int score;
} stu[20],change;
shuru()
{int i,c;
FILE * fp;
settextstyle(2,HORIZ_DIR,5);setcolor(BLACK);
for(i=n;;i++)
{n=n+1;
setfillstyle(1,YELLOW);
bar(2,73,638,455);
outtextxy(170,80,"Now you are inputing information.");
gotoxy(15,10);printf("Input student %d message:",i+1);
gotoxy(22,12);printf(" Num :");
gotoxy(32,12); setcolor(BLUE);scanf("%s",stu[i].num);
setcolor(BLACK);
gotoxy(22,14);printf(" Name:");
gotoxy(32,14);scanf("%s",stu[i].name);
gotoxy(22,16);printf("Score:");
gotoxy(32,16);scanf("%d",&stu[i].score);
outtextxy(110,275,"Enter 'S' to stop input and other key continue...");
c=getch();
if(c=='s'||c=='S')
{setcolor(YELLOW);
outtextxy(180,360,"The light-strip can move now.");
outtextxy(190,380,"You can do other program!");
outtextxy(225,410,"
<list or Sort >");
settextstyle(1,HORIZ_DIR,4);
outtextxy(240,310,"STOP!");
break;}
}
fp=fopen("c:\\s.txt","w");
for(i=0;i<n;i++)
if(fwrite(&stu[i],sizeof(struct student),1,fp)!=1)
printf("file write error!\n");
fclose(fp);
}
shuchu()
{int i;
FILE *fp;
setcolor(LIGHTRED);
if((fp=fopen("c:\\s.txt","r"))==NULL)
{settextstyle(1,HORIZ_DIR,2);
outtextxy(110,70,"ERROR !");}
settextstyle(1,HORIZ_DIR,2);
outtextxy(210,75,"The Students` Data");
for(i=0;fread(&stu[i],sizeof(struct student),1,fp)!=0;i++)
{gotoxy(22,9+2*i);printf("%s",stu[i].num);
gotoxy(35,9+2*i);printf("%s",stu[i].name);
gotoxy(57,9+2*i);printf("%d",stu[i].score);
outtextxy(135,125+32*i,"|");outtextxy(250,125+32*i,"|");
outtextxy(420,125+32*i,"|");outtextxy(490,125+32*i,"|");
outtextxy(140,105,"-------------------------");
outtextxy(140,140+32*i,"-------------------------");}
fclose(fp);
}
sort()
{FILE *fp;
int i,j;
settextstyle(1,HORIZ_DIR,2);setcolor(LIGHTBLUE);
fp=fopen("c:\\s.txt","r");
for(i=0;i<n;i++)
for(j=i+1;j<n;j++)
if(stu[i].score<stu[j].score)
{change=stu[i];stu[i]=stu[j];stu[j]=change;}
outtextxy(210,75,"The sort permition");
fp=fopen("c:\\s_sort.txt","w");
for(i=0;i<n;i++)
{fwrite(&stu[i],sizeof(struct student),1,fp);
gotoxy(22,9+2*i);printf("%s",stu[i].num);
gotoxy(35,9+2*i);printf("%s",stu[i].name);
gotoxy(57,9+2*i);printf("%d",stu[i].score);
outtextxy(135,125+32*i,"|");outtextxy(250,125+32*i,"|");
outtextxy(420,125+32*i,"|");outtextxy(490,125+32*i,"|");
outtextxy(140,105,"-------------------------");
outtextxy(140,140+32*i,"-------------------------");}
fclose(fp);
}
pic()
{int h,i,j;double z;double sum=0;double y=0;double x=0;double per;
FILE *fp;
fp=fopen("c:\\s.txt","r");
setcolor(YELLOW);settextstyle(1,HORIZ_DIR,2);
outtextxy(10,90,"The picture of students`");
outtextxy(10,120,"score proportion :");
for(i=0;i<n;i++)
{sum=sum+stu[i].score;}
for(j=0;j<n;j++)
{z=360*stu[j].score/sum;
setcolor(j+1);setfillstyle(XHATCH_FILL,j+1);
y=y+z;
pieslice(310,230,x,y,100);x=y;}
for(h=0;h<n;h++)
{per=100*stu[h].score/sum;
setcolor(h+1);
setfillstyle(XHATCH_FILL,h+1);
pieslice(40+73*h,390,45,135,50);
/*setfillstyle(XHATCH_FILL,h+1);
bar3d(30+73*h,360,40+73*h,380,15,1);*/
gotoxy(5+9*h,25);printf("%.1f%",per);}
fclose(fp);
}
int x=-40,y;
int radiu=40;
</xmp>
<img src ="http://www.cnitblog.com/zhangjiang838/aggbug/26547.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/zhangjiang838/" target="_blank">悲惨的狼</a> 2007-05-01 03:15 <a href="http://www.cnitblog.com/zhangjiang838/articles/26547.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>简单的动画演示</title><link>http://www.cnitblog.com/zhangjiang838/articles/26546.html</link><dc:creator>悲惨的狼</dc:creator><author>悲惨的狼</author><pubDate>Mon, 30 Apr 2007 19:13:00 GMT</pubDate><guid>http://www.cnitblog.com/zhangjiang838/articles/26546.html</guid><wfw:comment>http://www.cnitblog.com/zhangjiang838/comments/26546.html</wfw:comment><comments>http://www.cnitblog.com/zhangjiang838/articles/26546.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/zhangjiang838/comments/commentRss/26546.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/zhangjiang838/services/trackbacks/26546.html</trackback:ping><description><![CDATA[<xmp>/********************************/
/*	TurboC 2.0下运行通过    */
/*	简单的图像演示		*/
/*  http://huaigong.myrice.com	*/
/********************************/
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<graphics.h>
#define RED 4
#define LIGHTRED 12
float rad=3.1415926/180.0;
float k=640/480;
void star();
void shine(int R,int r,int data)
{
int x0[36],y0[36];
int x1[36],y1[36];
int i,data0=0;
int X=getmaxx()/2,Y=getmaxy()/2;
for(i=0;i<18;i++)
{x0[i]=X+r*sin((data0+data)*rad);
y0[i]=Y+k*r*cos((data0+data)*rad);
x1[i]=X+R*sin((data0+data)*rad);
y1[i]=Y+k*R*cos((data0+data)*rad);
data+=20;
setcolor(random(255));
delay(20);
line(x0[i],y0[i],x1[i],y1[i]);
}
}
main()
{float x,y,Radius;
int Driver=DETECT,Mode;
int step=0;
initgraph(&Driver,&Mode,"e:\\tc");
setbkcolor(1);
x=getmaxx()/2;y=getmaxy()/2;
Radius=getmaxy()/5;
star(x,y,Radius);
while(!kbhit())
{Radius=getmaxy()/4;
step=20+random(40);
shine(Radius,Radius+step,0);delay(100);
step+=20;Radius+=20;
shine(Radius,Radius+step,10);delay(100);
step+=20;Radius+=20;
shine(Radius,Radius+step,20);delay(200);
}
exit(0);
}
void star(x0,y0,R)
float x0,y0,R;
{
int x[5],y[5],x1[5],y1[5];
float r;
int i,a=18;
for(i=0;i<5;i++)
{x[i]=x0+R*cos(a*rad)*k;
y[i]=y0-R*sin(a*rad);
a+=72;
}
r=R*(sin(18*rad)/sin(54*rad));
a=54;
for(i=0;i<5;i++)
{x1[i]=x0+r*cos(a*rad)*k;
y1[i]=y0-r*sin(a*rad);
a+=72;
}
setcolor(RED);
line(x0,y0,x[0],y[0]);
line(x0,y0,x1[4],y1[4]);
line(x[0],y[0],x1[4],y1[4]);
setfillstyle(SOLID_FILL,RED);
floodfill(x1[4],y1[4]-1,RED);
setcolor(RED);
line(x0,y0,x[2],y[2]);
line(x0,y0,x1[2],y1[2]);
line(x[2],y[2],x1[2],y1[2]);
setfillstyle(SOLID_FILL,RED);
floodfill(x1[2],y1[2]-1,RED);
setcolor(LIGHTRED);
line(x[0],y[0],x1[0],y1[0]);
line(x0,y0,x1[0],y1[0]);
line(x0,y0,x[0],y[0]);
setfillstyle(SOLID_FILL,LIGHTRED);
floodfill(x1[0],y[0]+1,LIGHTRED);
setcolor(RED);
line(x0,y0,x1[0],y1[0]);
line(x0,y0,x[1],y[1]);
setfillstyle(SOLID_FILL,LIGHTRED);
floodfill(x1[0]-1,y1[0],RED);
setcolor(LIGHTRED);
line(x[1],y[1],x1[1],y1[1]);
line(x1[1],y1[1],x[2],y[2]);
line(x0,y0,x[1],y[1]);
line(x0,y0,x[2],y[2]);
setcolor(LIGHTRED);
line(x0,y0,x1[2],y1[2]);
line(x0,y0,x[3],y[3]);
line(x1[2],y1[2],x[3],y[3]);
setfillstyle(SOLID_FILL,LIGHTRED);
floodfill(x1[2]+1,y1[2]+1,LIGHTRED);
floodfill(x1[1]+1,y1[1]+1,LIGHTRED);
setcolor(RED);
line(x0,y0,x[3],y[3]);
line(x0,y0,x[4],y[4]);
line(x[3],y[3],x1[3],y1[3]);
line(x1[3],y1[3],x[4],y[4]);
setfillstyle(SOLID_FILL,RED);
floodfill(x1[3],y1[3]-1,RED);
setcolor(LIGHTRED);
line(x0,y0,x[4],y[4]);
line(x0,y0,x1[4],y1[4]);
line(x[4],y[4],x1[4],y1[4]);
setfillstyle(SOLID_FILL,LIGHTRED);
floodfill(x1[4]-1,y1[4]+1,LIGHTRED);
}
</xmp>
<img src ="http://www.cnitblog.com/zhangjiang838/aggbug/26546.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/zhangjiang838/" target="_blank">悲惨的狼</a> 2007-05-01 03:13 <a href="http://www.cnitblog.com/zhangjiang838/articles/26546.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>聆听混沌的声音</title><link>http://www.cnitblog.com/zhangjiang838/articles/26545.html</link><dc:creator>悲惨的狼</dc:creator><author>悲惨的狼</author><pubDate>Mon, 30 Apr 2007 19:12:00 GMT</pubDate><guid>http://www.cnitblog.com/zhangjiang838/articles/26545.html</guid><wfw:comment>http://www.cnitblog.com/zhangjiang838/comments/26545.html</wfw:comment><comments>http://www.cnitblog.com/zhangjiang838/articles/26545.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/zhangjiang838/comments/commentRss/26545.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/zhangjiang838/services/trackbacks/26545.html</trackback:ping><description><![CDATA[<p align=center><font size=3><strong><font color=#cc0000>聆听混沌的声音</font></strong></font></p>
<p>　　本世纪70年代初，美国普林斯顿大学的生态学家R&#183;May在研究昆虫群体繁殖规律时提出一个著名的模型： &#967;[n＋1]=k＊&#967;[n]＊(1－&#967;[n])<br></p>
<p>　　其中&#967;[n]表示第n代群体的数目。当给定一个初始的&#967;[0]值，然后不停地迭代，人们发现随着k值的不同，得到的序列&#967;n 有许多有趣的现象。当k值介于0与1之间时，&#967;[n]经过一定次数的迭代后都趋于0。当k值介于1和3之间时趋于1/k，当k值大于3时，经过一定次数的迭代后&#967;[n]在2个值之间交替变化，k值增加到3.449附近时，交替变化值又变为4个。继续增加k值，&#967;[n]交替变化的值的个数依4&#8594;8&#8594;16&#8594;32的次序迅速加倍，终于一片混沌。但当k值在3.835附近时，经过一定次数的迭代后，&#967;[n]非常简单地在3个值之间交替变化，接着又迅速依3&#8594;6&#8594;12的次序迅速增长。如此反复，在简单的方程中隐藏着令人惊奇的复杂性。&#967;[n]随k的变化情况如下图所示：<br><br>　　为了体现这种复杂之中的无穷奥妙，下面这个用TC2.0编写的小程序用&#967;[n]大小来控制PC喇叭的发音频率，设定不同的k值，我们就可以聆听到混沌的声音。<br>　　<font color=#009900>＃include <dos.h><br>　　＃include <stdio.h><br>　　main(){<br>　　int fMin=20,fMax=16000; /＊fMin代表最低频率，fMax代表最高频率＊/<br>　　int fDis,i,j; /＊fDis代表最高频率和最低频率之间的差值＊/<br>　　/＊i,j用于循环记数＊/<br>　　float x=0.1,k; /＊x代表x[n]的大小，设定其初始值为0.1，即x[0]=0.1＊/<br>　　fDis=fMax－fMin;<br>　　for(j=1;;j＋＋){<br>　　printf("Please input The value of k(1－4.0)\n"); /＊输入k值＊/<br>　　printf("If you want to quit,Please input:0\n"); /＊如果k=0退出＊/<br>　　scanf("％f",＆k);<br>　　if (k==0) break;<br>　　for(i=1;i&lt;100;i＋＋) /＊去除开始的100个点＊/<br>　　x=k＊x＊(1－x);<br>　　for (i=1;i&lt;100;i＋＋){<br>　　x=k＊x＊(1－x); /＊计算x的值＊/<br>　　sound(x＊fDis＋20); /＊用x的值控制PC喇叭的发音频率＊/<br>　　delay(1000); }<br>　　nosound(); }}<br>　　</font>执行上面的小程序时，k值就相当于一个&#8220;调音旋钮&#8221;。当将k值设定在1与3之间时，喇叭里传出的只有一个音调，重复又烦人。当k值稍稍大于3时，便开始有了韵律：so－mi－so－mi&#8230;。k值增加到3.449时，变成了so－fa－la－mi－so－fa－la－mi&#8230;，再增加k值，韵律更加复杂，终于成了现代抽象派作曲家的音乐作品。但是韵律并不是随着k值的增加无限地复杂下去。在k值增加到3.835时，音调又变成了mi－so－ti－mi－so－ti&#8230;，再增加k值又迅速地变得更加复杂。<br>不停地改变k值，仔细聆听，会听到混沌中的无限奥妙。</p>
<img src ="http://www.cnitblog.com/zhangjiang838/aggbug/26545.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/zhangjiang838/" target="_blank">悲惨的狼</a> 2007-05-01 03:12 <a href="http://www.cnitblog.com/zhangjiang838/articles/26545.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>用C语言画分形图 </title><link>http://www.cnitblog.com/zhangjiang838/articles/26544.html</link><dc:creator>悲惨的狼</dc:creator><author>悲惨的狼</author><pubDate>Mon, 30 Apr 2007 19:11:00 GMT</pubDate><guid>http://www.cnitblog.com/zhangjiang838/articles/26544.html</guid><wfw:comment>http://www.cnitblog.com/zhangjiang838/comments/26544.html</wfw:comment><comments>http://www.cnitblog.com/zhangjiang838/articles/26544.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/zhangjiang838/comments/commentRss/26544.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/zhangjiang838/services/trackbacks/26544.html</trackback:ping><description><![CDATA[<xmp>#include "graphics.h"
#include "stdlib.h"
#include "stdio.h"
#include "fcntl.h"
#include "dos.h"
union REGS r;
struct MOUSE{
int getit;
int x1;
int y1;
int x2;
int y2;
}ms;
void MSB(float,float,float,float,int,int,int,int,int);
void mouse_drop(struct MOUSE *in);
/*定义鼠标拖动的函数,通过鼠标的按下、放开来选定一个矩形区域*/
int data_processor(struct MOUSE m,float *x0,float *x1,float *y0,float *y1);
/*将鼠标选定的区域转化成MSB集的区域*/
void mouse_IQR(int *num,int *bx,int *cx,int *dx)
{/*调用鼠标的中断，在这里定义函数让下面一些函数调用，以减少编程的重复，
在这里，通过int86函数（在dos.h里）调用中断，鼠标的中断号为：33h */
r.x.ax=*num;
r.x.bx=*bx;
r.x.cx=*cx;
r.x.dx=*dx;
int86(0x33,&r,&r);
*bx=r.x.bx;
*cx=r.x.cx;
*dx=r.x.dx;
*num=r.x.ax;
}
int init_mouse()
{
/*初试化鼠标，查询鼠标驱动有没有安装，功能号为 0 */
int num=0;
mouse_IQR(&num,&num,&num,&num);
if(num!=-1)
return 1;
else return 0;
}
void mouse_show();
void mouse_position(int *x,int *y)
{/*鼠标在屏幕中所处的位置*/
int button=0,num=3;
mouse_show();
mouse_IQR(&num,&button,x,y);
}
void mouse_hide()
{/*隐藏鼠标光标*/
int num=2;
mouse_IQR(&num,&num,&num,&num);
}
void mouse_show()
{/*显示鼠标光标*/
int num=1;
mouse_IQR(&num,&num,&num,&num);
}
int mouse_click(int k)
{/*查询鼠标是使用左键（返回1）还是右键（返回2）*/
int bx=0,num=3;
mouse_IQR(&num,&bx,&num,&num);
return(bx&k);
}
void waiton(int buttom)
{/*等待鼠标动作*/
if(buttom==1)
while(mouse_click(1));
if(buttom==2)
while(mouse_click(2));
}
int mousexy(int x1,int y1,int x2,int y2)
{/*查询鼠标是否在区域内*/
int x,y;
mouse_position(&x,&y);
if(x>x1&&xy1&&yL||m<-1e10) break;
x=xx;
y=yy;
}
color=n%16;
putpixel(x1+i,y1+j,color);
}
}
}
void mouse_drop(struct MOUSE *in)
{
char out[20];
int x,y;
int oldx,oldy;
struct MOUSE r;
r=*in;
setwritemode(1);
setlinestyle(USERBIT_LINE,0x7777,1);
setcolor(15);
if(r.getit==1)
{
mouse_hide();
rectangle(r.x1,r.y1,r.x2,r.y2);
mouse_show();
}
mouse_position(&x,&y);
r.x1=x;
r.y1=y;
oldx=x;
oldy=y;
r.getit=1;
mouse_hide();
rectangle(x,y,x,y);
mouse_show();
while(mouse_click(1)) {mouse_position(&x,&y);
if(oldx!=x || oldy!=y){
mouse_hide();
rectangle(r.x1,r.y1,x,y);
rectangle(r.x1,r.y1,oldx,oldy);
mouse_show();
oldx=x;
oldy=y;
}
if(mouse_click(2)){
r.getit=0;
mouse_hide();
rectangle(r.x1,r.y1,oldx,oldy);
mouse_show();
waiton(2);
break;}
}
if(r.getit==1){
r.x2=x;
r.y2=y;
if(x==r.x1 && r.y1==y)
r.getit=0;
else
r.getit=1;
}
setlinestyle(SOLID_LINE,0,1);
*in=r;
waiton(1);
setwritemode(0);
setmouse(0,0,getmaxx(),getmaxy());
}
int data_processor(struct MOUSE m,float *x0,
float *x1,float *y0,float *y1)
{
float d1,l1,d2,l2,d,l;
float xx0,xx1,yy0,yy1,x,y;
d1=*x1-*x0;
l1=*y1-*y0;
d2=637;
l2=477;
xx0=m.x1;
xx1=m.x2;
yy0=m.y1;
yy1=m.y2;
if(xx0==xx1 || yy0==yy1) return(0);
if(xx0>xx1)
{x=xx0;
xx0=xx1;
xx1=x;
}
if(yy0>yy1)
{x=yy0;
yy0=yy1;
yy1=x;
}
d=1;
l=1;
x=*x0;
y=*y0;
*x0=x+(xx0-d)*d1/d2;
*x1=x+(xx1-d)*d1/d2;
*y0=y+(yy0-l)*l1/l2;
*y1=y+(yy1-l)*l1/l2;
if(*x0==*x1 || *y0==*y1)
return(0);
else
return(1);
}
</xmp>
<img src ="http://www.cnitblog.com/zhangjiang838/aggbug/26544.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/zhangjiang838/" target="_blank">悲惨的狼</a> 2007-05-01 03:11 <a href="http://www.cnitblog.com/zhangjiang838/articles/26544.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Turbo C 2.0 函数中文说明大全</title><link>http://www.cnitblog.com/zhangjiang838/articles/26543.html</link><dc:creator>悲惨的狼</dc:creator><author>悲惨的狼</author><pubDate>Mon, 30 Apr 2007 19:08:00 GMT</pubDate><guid>http://www.cnitblog.com/zhangjiang838/articles/26543.html</guid><wfw:comment>http://www.cnitblog.com/zhangjiang838/comments/26543.html</wfw:comment><comments>http://www.cnitblog.com/zhangjiang838/articles/26543.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/zhangjiang838/comments/commentRss/26543.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/zhangjiang838/services/trackbacks/26543.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: &lt;!--StartFragment--&gt;Ctrl+F 查找&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb...&nbsp;&nbsp;<a href='http://www.cnitblog.com/zhangjiang838/articles/26543.html'>阅读全文</a><img src ="http://www.cnitblog.com/zhangjiang838/aggbug/26543.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/zhangjiang838/" target="_blank">悲惨的狼</a> 2007-05-01 03:08 <a href="http://www.cnitblog.com/zhangjiang838/articles/26543.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>