?? commain.h
字號:
#include<iostream.h>
#include<conio.h>
#include<graphics.h>
#include<dos.h>
#include<process.h>
#include<stdlib.h>
#include<stdio.h>
#include<string.h>
//#include"c:\tc\bin\sysinfo.h"
//#include"c:\tc\bin\cominfo.h"
//#include"c:\tc\bin\bufinfo.h"
#include"c:\tc\bin\combufin.h"
//void main();
last();
int hspe=0,hspe1=0,hcom[10],hz=0,hres=1,hx=105,hy=120,hl=105,hr=120,ht=115,hb=135,hi=0,hcount=0;
char hnum[5],hc;
int hn=0;
void hca1(char hch);
int hconvertstr();
commain()
{
int gm=VGAHI,gd=VGA;
initgraph(&gd,&gm,"c:\\tc\\bgi");
cleardevice();
settextstyle(TRIPLEX_FONT,HORIZ_DIR,3);
outtextxy(110,40,"COMPUTER SELECTION SIMULATION");
line(105,70,500,70);
setcolor(LIGHTMAGENTA);
line(5,5,637,5);
line(5,5,5,470);
line(5,470,637,470);
line(10,10,630,10);
line(10,10,10,465);
line(10,465,630,465);
line(630,465,630,10);
line(637,470,637,5);
settextstyle(2,0,5);
setcolor(4);
fillellipse(25,110,3,3);
outtextxy(40,100,"Press 1 to Input new set of data");
fillellipse(25,160,3,3);
outtextxy(40,150,"Press 2 to view the Computer and Buffer you have entered");
fillellipse(25,210,3,3);
outtextxy(40,200,"Press 3 to Output the Best Computer Combination and Graph");
fillellipse(25,260,3,3);
outtextxy(40,250,"Press 4 to EXIT");
outtextxy(80,350,"Enter your Choice....");
char hch;
for(;;)
{
hch=getch();
if(hch=='0'||hch=='1'||hch=='2'||hch=='3'||hch=='4'||hch=='5'||hch=='6'||hch=='7'||hch=='8'||hch=='9')
{
if(hch!='\r')
{hc=hch;}
hca1(hch);
}
if((hch=='\r')){break;}
}
switch(hc)
{
case'1' :
ccom=0,cz=0,cz1=0;
ci=0,cn=0,ck=0;
cx=130,cl=130,ct=155,cr=230,cb=165,cy=153;
xcom=0,xz=0,xz1=0;
xi=0,xn=0,xk=0;
xx=130,xl=130,xt=155,xr=230,xb=165,xy=153;
hn=0,hspe=0,hspe1=0,hz=0,hres=1,hx=105,hy=120,hl=105,hr=120,ht=115,hb=135,hi=0,hcount=0; zn=0,zspe=0,zspe1=0,zz=0,zres=1,zx=105,zy=120,zl=105,zr=120,zt=115,zb=135,zi=0,zcount=0;
closegraph();
sysinfo();
closegraph();
// cleardevice();
cominfo();
closegraph();
// cleardevice();
bufinfo();
closegraph();
// main();
break;
case'2' :closegraph();combufin();closegraph();break;
case'3' :closegraph();bestcom();break;
// case'4' :setfillstyle(1,BLACK);bar(300,340,350,380); outtext("4");break;
case'4' :last(); exit(0);break;
}
closegraph();
//cleardevice();
// for(int hi=0;hi<xk;hi++)
//{
// printf("\nthe %d computer is %f",hi,xcomi[hi]);
// printf("\nthe %d computer cost is %f",hi,xcomc[hi]);
// }
// for(hi=0;hi<ck;hi++)
// {
// printf("\nthe %d buffer is %f",hi,ccomi[hi]);
// printf("\nthe %d buffer cost is %f",hi,ccomc[hi]);
// }
}
void hca1(char hch)
{
moveto(300,350);
settextstyle(2,0,5);
setcolor(24);
switch(hch)
{
case'1' :setfillstyle(1,BLACK); bar(300,340,350,380); outtext("1");break;
case'2' :setfillstyle(1,BLACK); bar(300,340,350,380); outtext("2");break;
case'3' :setfillstyle(1,BLACK);bar(300,340,350,380); outtext("3");break;
case'4' :setfillstyle(1,BLACK);bar(300,340,350,380); outtext("4");break;
// case'5' :setfillstyle(1,BLACK);bar(300,340,350,380); outtext("5");break;
}
}
last()
{
// int driver=DETECT,mode;
// initgraph(&driver,&mode,"c:\\tc\\bgi");
int uc;
for(uc=450;uc>=(-1000);uc-=5)
{
settextstyle(1,0,4);
setcolor(LIGHTCYAN);outtextxy(100,uc,"This Program was made by:");
setcolor(YELLOW);outtextxy(230,uc+50,"Satish M");
outtextxy(135,uc+100,"Sagar Subhas Kulkarni");
outtextxy(200,uc+150,"S J R College");
// outtextxy(188,c+200,"Maybelyn Abalos");
settextstyle(3,0,3);
setcolor(LIGHTBLUE);outtextxy(50,uc+240," V sem -Bacheloer of Computer Application");
settextstyle(3,0,4);setcolor(YELLOW);outtextxy(230,uc+315,"Submitted to:");
settextstyle(1,0,5);outtextxy(250,uc+350,"Mr. Asif");
settextstyle(3,0,4);
setcolor(LIGHTBLUE);outtextxy(135,uc+393,"(Instructor naming 'ASIF')");
setcolor(LIGHTMAGENTA);settextstyle(7,0,6);outtextxy(90,uc+650,"All Right Reserved");
settextstyle(7,0,3);outtextxy(220,uc+720,"(September 2008)");
delay(200);
clearviewport();
}
// return;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -