#include
#include
char answer[2]={' ',0};
char ch;
int score=0;
main()
{ int n=0;
int title(int n);
int space(int n);
int ti_one(int n);
int ti_two(int n);
int ti_three(int n);
int ti_four(int n);
int ti_five(int n);
int ti_six(int n);
int ti_seven(int n);
int ti_eight(int n);
int ti_nine(int n);
int ti_ten(int n);
int ti_eleven(int n);
int ti_twelve(int n);
int ti_thirteen(int n);
int ti_forteen(int n);
int ti_fifteen(int n);
int gdriver=VGA,gmode=VGAHI;
initgraph(&gdriver,&gmode,"");
n=title(n);
n=space(n);
n=ti_one(n);
n=ti_two(n);
n=ti_three(n);
n=ti_four(n);
n=ti_five(n);
n=ti_six(n);
n=ti_seven(n);
n=ti_eight(n);
n=ti_nine(n);
n=ti_ten(n);
n=ti_eleven(n);
n=ti_twelve(n);
n=ti_thirteen(n);
n=ti_forteen(n);
n=ti_fifteen(n);
gotoxy(26,15);
printf("YOUR IQ INDEX NUMBER IS %d",n);
setfillstyle(SOLID_FILL,BLUE);
bar(0,0,639,20);
setfillstyle(SOLID_FILL,BLUE);
bar(0,459,639,479);
getch();
closegraph();
}
title(int n)
{ setfillstyle(SOLID_FILL,BLUE);
bar(0,0,639,20);
setfillstyle(SOLID_FILL,BLUE);
bar(0,459,639,479);
setfillstyle(SOLID_FILL,WHITE);
bar(30,40,170,80);
bar(70,80,130,250);
bar(30,250,170,290);
fillellipse(300,165,100,120);
bar(330,200,370,300);
bar(370,260,400,300);
setfillstyle(SOLID_FILL,BLACK);
fillellipse(300,165,50,60);
setfillstyle(SOLID_FILL,WHITE);
bar(300,200,332,250);
setfillstyle(SOLID_FILL,RED);
bar(340,320,420,335);
bar(375,335,390,390);
bar(430,320,490,340);
bar(430,320,440,390);
bar(440,350,490,365);
bar(440,375,490,390);
bar(500,320,560,335);
bar(500,320,515,360);
bar(500,350,560,365);
bar(540,365,560,390);
bar(500,375,560,390);
bar(570,320,630,335);
bar(595,335,610,390);
outtextxy(470,430,"PROGRAMED BY YIWEI ");
ch = bioskey(0);
ch = ch & 0xff;
answer[0]=ch;
n=n;
ch = bioskey(0);
return(n);
}
ti_one(int n)
{ setfillstyle(SOLID_FILL,BLUE);
bar(0,0,639,20);
setfillstyle(SOLID_FILL,BLUE);
bar(0,459,639,479);
setfillstyle(SOLID_FILL,RED);
bar(440,0,570,20);
setfillstyle(SOLID_FILL,GREEN);
bar(440,459,570,480);
printf("\n\n1. Two ducks and two dogs have a total of fourteen legs. \n\n");
printf("\n\n T=TRUE F=FALSE( )\n");
ch = bioskey(0);
ch = ch & 0xff;
answer[0]=ch;
outtextxy(350,100,answer);
if((ch=='f')||(ch=='F'))
{ n+=10;
outtextxy(450,465,"you are right!");
}
else {n=n;
outtextxy(450,465,"you are wrong!");
}
score=n;
outtextxy(450,6,"the score = ");
gotoxy(70,1);
printf("%d",score);
ch = bioskey(0);
setfillstyle(SOLID_FILL,BLACK);
bar(0,0,639,479);
setfillstyle(SOLID_FILL,BLUE);
bar(0,0,639,20);
setfillstyle(SOLID_FILL,BLUE);
bar(0,459,639,479);
return(n);
}
space(int n)
{ ch = bioskey(0);
ch = ch & 0xff;
answer[0]=ch;
n=n;
ch = bioskey(0);
setfillstyle(SOLID_FILL,BLACK);
bar(0,0,639,479);
return(n);
}
ti_two(int n)
{ setfillstyle(SOLID_FILL,BLUE);
bar(0,0,639,20);
setfillstyle(SOLID_FILL,BLUE);
bar(0,459,639,479);
setfillstyle(SOLID_FILL,RED);
bar(440,0,570,20);
setfillstyle(SOLID_FILL,GREEN);
bar(440,459,570,480);
printf("\n\n2. A pie can be cut into more than seven pieces by\n\nmaking only four diameter cuts through its center.");
printf("\n\nT=TRUE F=FALSE( )\n");
ch = bioskey(0);
ch = ch & 0xff;
answer[0]=ch;
outtextxy(270,100,answer);
if((ch=='t')||(ch=='T'))
{ n+=10;
outtextxy(450,465,"you are right!");
}
el
--------------------next---------------------