p align="left"> { s[p]=a; p++; s[p]='\x0';} bar(302,225,302+textwidth(s),226+textheight(s)); if (a==8) if (p>0) s[--p]='\x0'; outtextxy(302,225,s); if(strlen(s)>15) { outtextxy(250,220,"Ѓ®«миҐ бЁ¬ў®«®ў ўўҐбвЁ Ґ«м§п!!!!"); outtextxy(250,230," „«п Їа®¤®«¦ҐЁп ¦¬ЁвҐ Enter"); do { a=getch(); }while (a!=13); } }while(a!=13); setfillstyle(SOLID_FILL,0); bar(164,24,606,446); con=atoi(s); i=0;j=0;x=0;k=0; outtextxy(175,30,"Ќ®¬ €¤ҐЄб Ќ §ў ЁҐ `㬬 Љ«оз"); do { i++;x+=10;j++; if (i==nach) { do { i++; } while (i>=con); } itoa(j,c,10); outtextxy(180,50+x,c); outtextxy(220,50+x,ukz[i].nazv); outtextxy(290,50+x,ukz[i].kol); outtextxy(390,50+x,ukz[i].sum); outtextxy(460,50+x,ukz[i].kl); }while (i!=n); getch(); } void load(void) { FILE *in; char fname[11]; int i=1; setfillstyle(SOLID_FILL,0); setcolor(4); outtextxy(300,152,"‚ўҐ¤ЁвҐ Ё¬п д ©« !!!(*.in)"); outtextxy(315,162,"max 20 бЁ¬ў®«®ў:_"); rectangle(301,174,463,185); imya(); in = fopen(s,"r"); do { fgets(ukz->nazv,10,in); fgets(ukz->kol,10,in); fgets(ukz->sum,10,in); fgets(ukz->kl,10,in); i++; k++; } while(!feof(in)); rewind(in); i=1; outtextxy(175,30,"Ќ®¬ €¤ҐЄб Ќ §ў ЁҐ `㬬 Љ«оз"); ukz=(struct type *)malloc(sizeof(struct type)*k); do {i++; itoa(i-1,c,10); x+=10; outtextxy(180,50+x,c); fscanf(in,"%s",ukz[i-1].nazv); outtextxy(220,50+x,ukz[i-1].nazv); fscanf(in,"%s",ukz[i-1].kol); outtextxy(290,50+x,ukz[i-1].kol); fscanf(in,"%s",ukz[i-1].sum); outtextxy(390,50+x,ukz[i-1].sum); fscanf(in,"%s",ukz[i-1].kl); outtextxy(460,50+x,ukz[i-1].kl); n=i; }while (!feof(in)); fclose(in); } openf (char s[20]) { setfillstyle(SOLID_FILL,0); bar(164,24,606,446); z=0; k=0; in=fopen(s,"r"); setviewport(164,24,606,446,0); rewind(in); while(fgets(cd,53,in)!=NULL) { a=strlen(cd); if(cd[a-1]=='\n') cd[a-1]=' '; setcolor(7); outtextxy(10,10+x,cd); x+=10; k++; } a=getch(); while (a!=27) { a=getch(); } k=0; x=0; clearviewport(); setviewport(0,0,639,479,0); fclose(in); return(0); } void imya() { p=0; do{ a=getch(); if ((a!=13)&&(a!=8)&&(a!=27)) { s[p]=a; p++; s[p]='\x0';} bar(302,175,302+textwidth(s),176+textheight(s)); if (a==8) if (p>0) s[--p]='\x0'; outtextxy(302,175,s); if(strlen(s)>19) { outtextxy(250,200,"Ѓ®«миҐ бЁ¬ў®«®ў ўўҐбвЁ Ґ«м§п!!!!"); outtextxy(250,210," „«п Їа®¤®«¦ҐЁп ¦¬ЁвҐ Enter"); do { a=getch(); }while (a!=13); } }while(a!=13); setfillstyle(SOLID_FILL,0); bar(164,24,606,446); } liniya (int k,int m,int n) { setcolor(n); line(130,20+k*60,130,50+k*60); line(20,50+k*60,130,50+k*60); setcolor(m); line(20,20+k*60,20,50+k*60); line(20,20+k*60,130,20+k*60); return 0; } liniya2(int i,int m,int n) { setcolor (m); line(20,300+i*60,20,330+i*60); line(20,300+i*60,130,300+i*60); setcolor (n); line(130,300+i*60,130,330+i*60); line(20,330+i*60,130,330+i*60); return 0; } void nomer1() { setfillstyle(SOLID_FILL,0); setcolor(4); outtextxy(300,202,"‚ўҐ¤ЁвҐ ®¬Ґа § ЇЁбЁ!!!(*.in)"); outtextxy(315,212,"max 2 бЁ¬ў®« :_"); rectangle(301,224,463,235); p=0; do{ a=getch(); if ((a!=13)&&(a!=8)&&(a!=27)) { s[p]=a; p++; s[p]='\x0';} bar(302,225,302+textwidth(s),226+textheight(s)); if (a==8) if (p>0) s[--p]='\x0'; outtextxy(302,225,s); if(strlen(s)>15) { outtextxy(250,220,"Ѓ®«миҐ бЁ¬ў®«®ў ўўҐбвЁ Ґ«м§п!!!!"); outtextxy(250,230," „«п Їа®¤®«¦ҐЁп ¦¬ЁвҐ Enter"); do { a=getch(); }while (a!=13); } }while(a!=13); setfillstyle(SOLID_FILL,0); bar(164,24,606,446); nom=atoi(s); i=0;j=0;x=0; outtextxy(175,30,"Ќ®¬ €¤ҐЄб Ќ §ў ЁҐ `㬬 Љ«оз"); m=n; do { x+=10; i++; j++; if((i==nom)&&(i==n)) break; if(i==nom){i++;m-=1;} itoa(j,c,10); outtextxy(180,50+x,c); outtextxy(220,50+x,ukz[i].nazv); outtextxy(290,50+x,ukz[i].kol); outtextxy(390,50+x,ukz[i].sum); outtextxy(460,50+x,ukz[i].kl); }while (i!=m); getch(); } void kluchik() { setfillstyle(SOLID_FILL,0); setcolor(4); outtextxy(300,202,"‚ўҐ¤ЁвҐ Є«оз (*.in)"); outtextxy(315,212,"max 2 бЁ¬ў®« :_"); rectangle(301,224,463,235); p=0; do{ a=getch(); if ((a!=13)&&(a!=8)&&(a!=27)) { s[p]=a; p++; s[p]='\x0';} bar(302,225,302+textwidth(s),226+textheight(s)); if (a==8) if (p>0) s[--p]='\x0'; outtextxy(302,225,s); if(strlen(s)>15) { outtextxy(250,220,"Ѓ®«миҐ бЁ¬ў®«®ў ўўҐбвЁ Ґ«м§п!!!!"); outtextxy(250,230," „«п Їа®¤®«¦ҐЁп ¦¬ЁвҐ Enter"); do { a=getch(); }while (a!=13); } }while(a!=13); setfillstyle(SOLID_FILL,0); bar(164,24,606,446); strcpy(kluch,s); v=s; i=0;j=0;x=0; outtextxy(175,30,"Ќ®¬ €¤ҐЄб Ќ §ў ЁҐ `㬬 Љ«оз"); do { x+=10; i++;j++; if (ukz[i-2].kl==v) i++; itoa(j,c,10); outtextxy(180,50+x,c); outtextxy(220,50+x,ukz[i-1].nazv); outtextxy(290,50+x,ukz[i-1].kol); outtextxy(390,50+x,ukz[i-1].sum); outtextxy(460,50+x,ukz[i-1].kl); }while (i!=n); getch(); } file (char str1[5],char str2[5],char str3[5]) { d2=1; setfillstyle(SOLID_FILL,1); for (i=0;i<3;i++) { bar(20,300+i*60,130,330+i*60); liniya2(i,9,0); } while (a!=27) { setcolor(6); outtextxy(27,310,str1); outtextxy(27,370,str2); outtextxy(27,430,str3); if ((a==80)||(a==72)) { if (a==80) d2++; if (a==72) d2--; if (d2>3) d2=1; if (d2<1) d2=3; } if ((d2==1)&&(nomer==1)) { setcolor(4); outtextxy(27,310,str1); liniya2(0,0,9); a=getch(); liniya2(0,9,0); if (a==13) { del(); }else continue; } if ((d2==1)&&(nomer==2)) { setcolor(4); outtextxy(27,310,str1); liniya2(0,0,9); a=getch(); if (a==13) { nomer1(); } liniya2(0,9,0); } if ((d2==2)&&(nomer==1)) { setcolor(4); outtextxy(27,370,str2); liniya2(1,0,9); a=getch(); if (a==13) { load(); } liniya2(1,9,0); } if ((d2==2)&&(nomer==2)) { setcolor(4); outtextxy(27,370,str2); liniya2(1,0,9); a=getch(); if (a==13) { kluchik(); } liniya2(1,9,0); } if ((d2==3)&&(nomer==2)) { setcolor(4); outtextxy(27,430,str3); liniya2(2,0,9); a=getch(); liniya2(2,9,0); if (a==13) { interval(); } else continue; liniya2(2,9,0); } } setfillstyle(SOLID_FILL,8); bar(20,300,130,460); return 0; } void interfice() { setfillstyle(SOLID_FILL,8); bar(0,0,640,480); setfillstyle(SOLID_FILL,0); bar(164,24,606,446); setfillstyle(SOLID_FILL,1); for (i=0;i<4;i++) { bar(20,20+i*60,130,50+i*60); liniya(i,9,0); } setfillstyle (SOLID_FILL,1); bar(160,20,163,450); bar(20,265,163,268); bar(160,20,610,23); bar(607,20,610,450); bar(160,447,610,450); d=1; while (ch!=27) { setcolor(6); outtextxy(60,30,"”Ђ‰‹"); outtextxy(45,90,"“„Ђ‹…Ќ€…"); outtextxy(45,150,"`ЏђЂ‚ЉЂ"); outtextxy(55,210,"‚›*Ћ„"); if ((a==80)||(a==72)) { if (a==80) d++; if (a==72) d--; if (d>4) d=1; if (d<1) d=4; } if (d==1) { nomer=1; setcolor(4); outtextxy(60,30,"”Ђ‰‹"); liniya(0,0,9); a=getch(); liniya(0,9,0); if (a==13) { file("Ћ--€`'ЉЂ","‡Ђѓђ“‡ЉЂ",""); }else continue; } if (d==2) { setcolor(4); nomer=2; outtextxy(45,90,"“„Ђ‹…Ќ€…"); liniya(1,0,9); a=getch(); liniya(1,9,0); if (a==13) { file("ЏЋ ЌЋЊ…ђ“","ЏЋ Љ‹ћ--“","ЏЋ €Ќ'…ђ‚Ђ‹“"); }else continue; } if ((d==3)) { setcolor(4); outtextxy(45,150,"`ЏђЂ‚ЉЂ"); liniya(2,0,9); a=getch(); liniya(2,9,0); if (a==13) { openf("e:\\bc31\\bin\\help.dat"); } else continue; } if (d==4) { setcolor(4); outtextxy(55,210,"‚›*Ћ„"); liniya(3,0,9); a=getch(); liniya(3,9,0); if (a==13) { break; } else continue; } } } void main(void) { initgraph(&driver,&mode,"e:\\bc31\\bin"); interfice(); closegraph(); }
Страницы: 1, 2, 3, 4
|