/* Name: Copyright: GNU Author: Lisovenko Serhiy Date: 04.04.06 10:42 Description: */#include <stdio.h>int abs(int a);int Dshift(int Y,int M,int D);int main(){float percent[]={100,99,98,96,95,92,88,85,83,80,78,70,60,57,50,43,40,36,30,25,22,17,15,8,4,3,2,1,0.5,0, 99,98,96,95,92,88,85,83,80,78,70,60,57,50,48,43,40,36,30,25,22,17,15,8,4,3,2,1,0.5},E;int pos[]={0,3,4,6,7,9,11,12,13,14,15,18,21,22,25,27,28,29,31,33,34,36,37,40,43,44,45,46,48,50,96,95,93,92,90,88,87,86,85,84,81,78,77,75,74,72,71,70,68,66,65,63,62,59,56,55,54,53,51};int year,month, day,Sh1,Delta,in,emot,phiz,i;printf("Enter day month year\t");scanf("%d",&day);scanf("%d",&month);scanf("%d",&year);Sh1= Dshift(year,month,day);printf("Enter other day month year\t");scanf("%d",&day);scanf("%d",&month);scanf("%d",&year);Delta=abs(Sh1-Dshift(year,month,day));printf("Difference is %d days\n",Delta);in=(int)((((float)Delta/32.)-(Delta/32))*100.);emot=(int)((((float)Delta/27.)-(Delta/27))*100.);phiz=(int)((((float)Delta/22.)-(Delta/22))*100.);for(i=0;pos[i]!=in;i++);printf("Intellectual: %g%%\n",percent[i]);E=percent[i];for(i=0;pos[i]!=emot;i++);printf("Emotional: %g%%\n",percent[i]);E+=percent[i];for(i=0;pos[i]!=phiz;i++);printf("Phisical: %g%%\n",percent[i]);E+=percent[i];printf("Middle: %g%%\n",E/3.);return 0;}int abs(int a){if(a>0)return a;return -a;}int Dshift(int Y,int M,int D){int N,i,Sh;int md[12]={31,28,31,30,31,30,31,31,30,31,30,31};N=Y-1;if((!(Y%4))&&(Y%100)||(!(Y%400)))md[1]=29;Sh=365*N+N/4-N/100+N/400;for(i=0;i<M-1;i++)Sh+=md[i];Sh+=D;return Sh;}