Apropiere
#include<iostream>Depărtare
#include<fstream>
#include<graphics.h>
using namespace std;
int main()
{initwindow(1360,950,"The Doppler Effect");
int aa,i=0,j,k,m,p,n,a=1000,b,c;
a=30;
aa=30;
b=300;
for(i=1;i<50;i++)
{
while(aa<=b-30)
{
a=a+3;
aa=aa+10;
if(aa%4==0)
b--;
setcolor(4);
delay(10);
circle(aa,a,30);
setfillstyle(1,4);
floodfill(aa,a,4);
delay(10);
setfillstyle(1,0);
floodfill(aa,a,0);
setcolor(15);
rectangle(b,0,b+10,750);
delay(10);
setcolor(0);
rectangle(b,0,b+10,750);
}
while(aa>50)
{
a=a+3;
aa=aa-10;
if(a%4==0)
b--;
setcolor(4);
delay(10);
circle(aa,a,30);
setfillstyle(1,4);
floodfill(aa,a,4);
delay(10);
setfillstyle(1,0);
floodfill(aa,a,0);
setcolor(15);
rectangle(b,0,b+10,750);
delay(10);
setcolor(0);
rectangle(b,0,b+10,750);
}
a=30;
aa=30;
}
delay(500000);
}
#include<iostream>Pe "scurt"
#include<fstream>
#include<graphics.h>
using namespace std;
int main()
{initwindow(1360,950,"The Doppler Effect");
int aa,i=0,j,k,m,p,n,a=1000,b,c;
a=30;
aa=30;
b=100;
for(i=1;i<=50;i++){
while(aa<=b-30)
{
a=a+5;
aa=aa+10;
if(a%2==0)
b++;
setcolor(4);
circle(aa,a,30);
setfillstyle(1,4);
floodfill(aa,a,4);
delay(1);
setfillstyle(1,0);
floodfill(aa,a,0);
setcolor(15);
rectangle(b,0,b+10,750);
delay(10);
setcolor(0);
rectangle(b,0,b+10,750);
}
while(aa>0)
{
a=a+5;
aa=aa-10;
if(a%2==0)
b++;
setcolor(4);
circle(aa,a,30);
setfillstyle(1,4);
floodfill(aa,a,4);
delay(10);
setfillstyle(1,0);
floodfill(aa,a,0);
setcolor(15);
rectangle(b,0,b+10,750);
delay(10);
setcolor(0);
rectangle(b,0,b+10,750);
}
a=30;
aa=30;
}
delay(500000);
}
#include<iostream> // -1 = apropiere; 1 = departare
#include<fstream>
#include<graphics.h>
using namespace std;
int main()
{initwindow(1360,950,"The Doppler Effect");
int aa,i=0,j,k,m,p,n,a=1000,b,c;
ifstream f("date");
f>>c;
if(c==1)
{a=30;
aa=30;
b=100;
for(i=1;i<=50;i++){
while(aa<=b-30)
{
a=a+5;
aa=aa+10;
if(a%2==0)
b++;
setcolor(4);
circle(aa,a,30);
setfillstyle(1,4);
floodfill(aa,a,4);
delay(1);
setfillstyle(1,0);
floodfill(aa,a,0);
setcolor(15);
rectangle(b,0,b+10,750);
delay(10);
setcolor(0);
rectangle(b,0,b+10,750);
}
while(aa>0)
{
a=a+5;
aa=aa-10;
if(a%2==0)
b++;
setcolor(4);
// delay(10);
circle(aa,a,30);
setfillstyle(1,4);
floodfill(aa,a,4);
delay(10);
setfillstyle(1,0);
floodfill(aa,a,0);
setcolor(15);
rectangle(b,0,b+10,750);
delay(10);
setcolor(0);
rectangle(b,0,b+10,750);
}
a=30;
aa=30;
}
delay(500000);
}
else
{a=30;
aa=30;
b=500;
for(i=1;i<50;i++)
{
while(aa<=b-30)
{
a=a+3;
aa=aa+10;
if(aa%4==0)
b--;
setcolor(4);
delay(10);
circle(aa,a,30);
setfillstyle(1,4);
floodfill(aa,a,4);
delay(10);
setfillstyle(1,0);
floodfill(aa,a,0);
setcolor(15);
rectangle(b,0,b+10,750);
delay(10);
setcolor(0);
rectangle(b,0,b+10,750);
}
while(aa>50)
{
a=a+3;
aa=aa-10;
if(a%4==0)
b--;
setcolor(4);
delay(10);
circle(aa,a,30);
setfillstyle(1,4);
floodfill(aa,a,4);
delay(10);
setfillstyle(1,0);
floodfill(aa,a,0);
setcolor(15);
rectangle(b,0,b+10,750);
delay(10);
setcolor(0);
rectangle(b,0,b+10,750);
}
a=30;
aa=30;
}
delay(500000);
}}