#include #include #include #include #include #include int gd,gm,i,j,x; char *nr_zi; int nrzile(int d,int m,int y); void inputt(char *sir,int *nr); void main() { int p[3]={23,28,33}; int q[5]; int d1,m1,y1,d2,m2,y2,i,n,nz,se,sen; float nr,sr; char *nume; clrscr(); printf("Nume"); gets(nume); printf("Data nasterii"); inputt("Ziua ",&d1); inputt("Luna ",&m1); inputt("Anul ",&y1); printf("Data de referinta"); inputt("Ziua ",&d2); inputt("Luna ",&m2); inputt("Anul ",&y2); nz=nrzile(d1,m1,y1); nz=nrzile(d2,m2,y2)-nz; detectgraph(&gd,&gm); initgraph(&gd,&gm,"C:\\BORLANDC\\BGI"); cleardevice(); outtextxy(100,20,"Bioritm pentru "); outtextxy(250,20,nume); for (i=0;i<3;i++) { setcolor(9+i); line(10,405+18*i,100,405+18*i); if (i==0) outtextxy(100,400+18*i,"fizic"); else if(i==1) outtextxy(100,400+18*i,"psihic"); else outtextxy(100,400+18*i,"intelect"); q[i]=nz%p[i]; nr=2*M_PI*q[i]/p[i]; sr=sin(nr); se=(sr+1)*80; for(n=nz;n<=nz+31;n++) { q[i]=n%p[i]; nr=2*M_PI*q[i]/p[i]; sr=sin(nr); sen=(sr+1)*160; line(24*(n-nz-1),480-(100+se),24*(n-nz),480-(100+sen)); se=sen; delay(10); } } setcolor(7); for (i=0;i<31;i++) { itoa(i,nr_zi,10); line(20*i,50,20*i,390); outtextxy(20*i+2,55,nr_zi); delay(10); } line(getmaxx(),50,getmaxx(),390); setcolor(15); line(0,220,getmaxx(),220); rectangle(0,50,getmaxx(),390); getch(); // closegraph(); } int nrzile(int d,int m,int y) { int r; const int nr[12]={0,31,59,90,120,151,181,212,243,273,304,334}; r=nr[m-1]; r=r+365*y+y/4+d+1; r=r-y/100+y/400; if (!((y%4!=0)||(y%400==0)||(y%100==0)||(m<2))) r--; return r; } void inputt(char *sir,int *nr) { printf("%s",sir); scanf("%d",nr); }