Регистрация: 23.10.2012
Сообщений: 5
|
Прошу немного помочь.с кодом с++
Проходит анимация, и конец программы. а должна продолжаться и вводить меню.. в чем ошибка,не могу понять. помогите.
и ещё может кто знает,Как задействовать русский язык?
было решено,методом научного тыка. вот так. может хоть объясните почему именно так?
Код:
#include<graphics.h>
#include<stdio.h>
#include<stdlib.h>
#include<iostream.h>
#include<conio.h>
#include<fstream.h>
#include<string.h>
#include<dos.h>
#include<process.h>
void vzruv()
{
setcolor(4);
int boom[48]={300,40,
280,90,
230,80,
260,150,
240,180,
280,190,
290,210,
320,170,
340,190,
350,130,
390,100,
340,90,
300,40};
setfillstyle(1,4);
fillpoly(12,boom);
setcolor(14);
int boom1[]={350,100,
330,100,
310,60,
290,100,
260,110,
280,130,
260,175,
310,140,
340,160,
330,130,
350,100};
setfillstyle(1,14);
fillpoly (10,boom1);
delay(100);
setcolor(6);
int boom3[]={330,110,
320,110,
310,80,
300,110,
280,120,
290,130,
280,150,
310,130,
330,150,
320,130,
330,110};
setfillstyle(1,6);
fillpoly(11,boom3);}
void graph()
{
cleardevice();
setcolor(14);
rectangle(100,20,540,460);
rectangle(95,15,545,465);
line(100,420,540,420);
line(100,370,540,370);
setbkcolor(0);
setcolor(15);
settextstyle(0,0,1);
outtextxy(120,380,"Rabotu wipolnil:");
outtextxy(270,380,"Pyzhenko I.S");
outtextxy(270,390,"student 1 kursa FIT gruppi 2a");
outtextxy(120,430,"Proverila: ");
outtextxy(270,430,"Kolomeiceva T.G.");
setcolor(15);
settextstyle(0,0,1);
outtextxy(150,50," Kursovaya rabota po progammirovaniy");
settextstyle(0,0,1);
}
void main1()
{
graph();
getch();
cleardevice();
int n;
do
{
setbkcolor(0);
setcolor(15);
outtextxy(54,120,"1 Zadanie kursovoi raboti");
outtextxy(250,70,"Wibirete deystwie:");
outtextxy(54,170,"2 Otcrit kursovuy rabotu VAriant 13");
outtextxy(54,220,"3 BbIXOD");
setcolor(14);
line(30,50,610,50);
line(30,50,30,250);
line(30,250,610,250);
line(610,250,610,50);
line(80,250,80,50);
line(30,100,610,100);
line(30,150,610,150);
line(30,200,610,200);
cin>>n;
switch(n)
{
case 1:
setcolor(1);
outtextxy(60,300,"Shema Gornera - algoritm vichisleniya znacheniya mnogochlena");
outtextxy(60,320,"zapisannogo v vide summi monomov (odnochlenov), pri zadannom");
outtextxy(60,340,"znachenii peremennoy. Metod Gornera pozvolyaet nayti korni mnogochlena");
outtextxy(60,360,"a takge vichislit proizvodnie polinoma v zadannoy tochke. Shema");
outtextxy(60,380,"Gornera takge yavlyaetsya prostim algoritmom dlya deleniya mnogochlena");
outtextxy(60,400,"na binom vida (x-c). Metod nazvan v chest Yilyama Dgordga Gornera.");
break;
case 2:exit(1);
break;
case 3:exit(1);
break;
}
closegraph();
}
while(1);
}
int main()
{
int gd,gm,err;
gd=DETECT;
initgraph(&gd,&gm,"");
err=graphresult();
if(err!=grOk)
{
printf("Error");
getch();
return 0;
}
cleardevice();
setbkcolor(11);
setcolor(8);
int aeroplan[54] = {250, 470, 250, 450, 280, 420, 280, 360,
270, 350, 220, 380, 220, 350, 270, 320,
270, 310, 280, 300, 280, 270, 290, 255,
300, 270, 300, 300, 310, 310, 310, 320,
360, 350, 360, 380, 310, 350, 300, 360,
300, 420, 330, 450, 330, 470, 310, 470,
300, 460, 280, 460, 270, 470};
setfillstyle(1, 8);
fillpoly(27, aeroplan);
setfillstyle(1,3);
setcolor(3);
fillellipse(100,100,23,15);
fillellipse(130,100,15,15);
fillellipse(160,100,23,15);
fillellipse(120,80,18,15);
fillellipse(140,80,18,15);
int size,size2;
size=imagesize(220,250,360,480);
void *arrow;
arrow=malloc(size);
getimage(220,250,360,480,arrow);
size2=imagesize(75,50,200,15);
void *oblachko;
oblachko=malloc(size2);
getimage(75,50,200,130,oblachko);
cleardevice();
for (int y=0; y<400; y=y+150)
{
for(int x=100;x<600;x=x+300)
{
putimage(x,y,oblachko,COPY_PUT);
delay(50);
}
}
free(oblachko);
setcolor(14);
setfillstyle(1,14);
fillellipse(0,0,100,100);
setlinestyle(2,4,3);
line(50,50,150,150);
line(10,50,45,200);
line(15,50,100,180);
line(55,150,75,200);
line(140,70,190,100);
line(150,110,190,149);
setcolor(14);
setfillstyle(1,14);
fillellipse(0,0,100,130);
for ( y=480; y>0; y--)
{
putimage(240,y,arrow,COPY_PUT);
delay(5);
}
free(arrow);
setlinestyle(0,0,0);
free(arrow);
vzruv();
setfillstyle(1,11);
delay(60);
bar(220,3,400,270);
vzruv();
setcolor(1);
settextstyle(0,0,0);
outtextxy(420,470,"Press Enter to continue");
getch();
main1();
return 0;
}
Последний раз редактировалось CjJack; 13.06.2013 в 21:53.
|