برنامه محاسبه سن به زبان C++ به همراه سورس کد کامل

در این برنامه با دریافت تاریخ امروز و تاریخ تولد سن محاسبه و سال و ماه و روز و ساعت و دقیقه عمر گذشته نشون داده میشود

عکس از صفحه اول برنامه برای دریافت تاریخ امروز :

 

صفحه مربوط به دریافت تاریخ تولد :

 

صفحه نمایش نتیجه محاسبات :

 

سورس کد برنامه محاسبه سن به زبان C++ :

#include conio.h
#include dos.h
#include stdio.h
#include iostream.h
#include stdlib.h
main(){
char cc,
asghar[38]="    ( ِّ¤ًّ ü÷ ù›‏—÷ ) ü¨ ù›‏—÷ ِ‏ھ‏گ",
www[24]="www.ArtaRoyan.ir",
man[32]="   ù¤َ¥‏¨ ü¨¤¢گ ِ‏ُ‏—‏‘¨ ’ّ ô‏÷ُ";
int a,b,c,s,m,r,n,i,j,x,a1,a2,a3;
randomize();
system("sepand.exe");system("vega.com");
textcolor(15);
window(1,1,80,25);textbackground(1);clrscr();
gotoxy(18,13);printf("%s","     .¥ّ¨‏َ‏گ ¢¤گّ ِ‏،‏¤‘— ِ‏÷ّ‏ّ“ üً ï¤ً ¥‏¨");
gotoxy(18,14);printf("%s","                         : ü،‏¤‘— ِ‏÷ّ‏“ ٌ‘™ُ");
gotoxy(18,18);printf("%s","    ¤—÷‏گ ù¢‏َî ùںê¬ گ¤÷ّ¨ ِ÷‏َ‏گ ¢¤گّ ü،‏¤‘—");
gotoxy(18,19);printf("%s","                            .¥ّ¨ى‘›گ¤ّ ِ‏¢‏َî");

window(37,16,42,16);textbackground(3);clrscr();
window(50,16,54,16);textbackground(3);clrscr();
window(23,16,29,16);textbackground(3);clrscr();

printf("%s"," 1385           6            9 ");

window(20,5,60,10);textbackground(6);clrscr();
gotoxy(1,3);printf("%s","     ٌ‏گ           üگ          ِّî ");
window(20,5,60,5);textbackground(2);clrscr();
gotoxy(1,2);printf("%s","      ùَ‏گ ¢¤گّ ِ‏،‏¤‘— ِ‏÷ّ‏ّ“ ùَ‏گ é¯َ");
window(23,8,29,8);textbackground(3);clrscr();
window(37,8,42,8);textbackground(3);clrscr();
window(50,8,54,8);textbackground(3);clrscr();
window(24,8,29,8);textbackground(3);clrscr();cin>>a1;
window(38,8,42,8);textbackground(3);clrscr();cin>>a2;
window(51,8,54,8);textbackground(3);clrscr();cin>>a3;
for(i=15;i<=40;i++){
	window(i,4,i,20);textbackground(1);clrscr();
	window(80-i,4,80-i,20);textbackground(1);clrscr();
	delay(100);
}
window(1,1,80,25);textbackground(1);clrscr();
x=0;
i=0;j=0;
while(x!=10){
	i=random(18);
	j=random(70);
	gotoxy(j,i);printf("%s","¥ّ¨“‏ًَ ©ّ،");
	delay(400);clrscr();
	x++;
}
window(1,1,80,25);textbackground(1);clrscr();
x=0;
while(x!=100)
    {
     textcolor(15);
     for(i=31;i>=3;i--)
       {gotoxy(i+20,15);cprintf("%c",man[i]);delay(50);}
     for(i=0;i<=24;i++)
       {gotoxy(i+26,17);cprintf("%c",www[i]);delay(50);}
     a=a1;
     b=a2;
     c=a3;
     s=1366;m=6;r=10;
     window(20,5,60,10);textbackground(6);clrscr();
     gotoxy(1,3);printf("%s","     ٌ‏گ           üگ          ِّî ");
     window(20,5,60,5);textbackground(2);clrscr();
     printf("%s","   .ùَ‏گ ¢¤گّ üّ¢َّّ—  ‏¤‘— ¥ّگ ùَ‏گ é¯َ");
     window(23,8,29,8);textbackground(3);clrscr();
     window(37,8,42,8);textbackground(3);clrscr();
     window(50,8,54,8);textbackground(3);clrscr();
     window(24,8,29,8);textbackground(3);clrscr();cin>>s;
     window(39,8,42,8);textbackground(3);clrscr();cin>>m;
     window(51,8,54,8);textbackground(3);clrscr();cin>>r;
     window(1,1,80,25);textbackground(1);clrscr();
     window(20,2,60,2);textbackground(2);clrscr();
     for(i=38;i>=0;i--){
		 gotoxy(i,1);
		 printf("%c",asghar[i]);
		 delay(50);
	 }
     window(20,3,60,12);textbackground(6);clrscr();
     gotoxy(1,2);printf("%s","                          ü،‏¤‘— ِ‏÷ّ‏ّ“");
     gotoxy(1,4);printf("%s","                    ü،‏¤‘— ِ‏ّ¢َّّ— ِ‏÷¨");
     gotoxy(3,2);cout<<a<<"/"<<b<<"/"<<c;
     gotoxy(3,4);cout<<s<<"/"<<m<<"/"<<r;
     window(20,7,60,20);textbackground(6);clrscr();
     textcolor(0);
     gotoxy(1,2);cprintf("%s","=========================================");
     if(c<r){b--;c=c+30;c=c-r;}
     else c=c-r;
     if(b<m){a--;b=b+12;b=b-m;}
     else b=b-m;
     a=a-s;
     gotoxy(31,3);printf("%s","ِّ÷‏¨ ِ‏÷¨");
     gotoxy(3,3);printf("%s","ٌ‏گ  üگ ِّî");
     gotoxy(3,4);cout<<a;
     gotoxy(8,4);cout<<b;
     gotoxy(11,4);cout<<c;
     i=0;j=0;
     i=(a*12)+b;
     j=(i*30)+c;
     gotoxy(1,5);cprintf("%s","=========================================");
     gotoxy(1,6);printf("%s","ّ“ üً‏¢ ِّî       ‘‏ üگ    ‘‏ ٌ‏گ    ¥‏¨");
     gotoxy(1,7);printf("%s","                         .¥ّ¨‏ھ‘‏ گ¢‘‏÷¢");
     gotoxy(1,8);cprintf("%s","=========================================");
     gotoxy(35,6);cout<<a;
     gotoxy(25,6);cout<<i;
     gotoxy(13,6);cout<<j;
     s=a;m=b;r=c;
     a=s+1;b=0;c=0;
     if(c<r){b--;c=c+30;c=c-r;}
     else c=c-r;
     if(b<m){a--;b=b+12;b=b-m;}
     else b=b-m;
     a=a-s;
     if(b!=0||c!=0){
       if(b!=0&&c!=0){gotoxy(1,9);printf("%s","      üَ‘ى ِّî    ّ üگ    ù¥ّ¢َّّ— ِّ¥‏¨");}
       if(b==0){gotoxy(1,9);printf("%s","üَ‘ى ِّî    ¯ىê ù¥ّ÷ّî وَُî ù‏‘‏÷¢ ِّ¥‏¨");}
       if(c==0){gotoxy(1,9);printf("%s","üَ‘ى  üگ    ¯ىê ù¥ّ÷ّî وَُî ù‏‘‏÷¢ ِّ¥‏¨");}
       gotoxy(1,10);printf("%s","ِ‏‘ھ‘‏¢‘ھ ë‘›‘َّگ¥ّ¢÷¨    ù¢،‏¤‘— ّ“ ¥‏¨");
		if(b!=0&&c!=0){
			gotoxy(16,9);cout<<c;
			gotoxy(24,9);cout<<b;
		}
       if(b==0){gotoxy(10,9);cout<<c;}
       if(c==0){gotoxy(10,9);cout<<b;}
       gotoxy(24,10);cout<<s+1;
	  }
     if(b==0&&c==0){
       gotoxy(1,9);printf("%s"," ü¢¥ّ¢َّّ— ِّ¥‏¨ ِّ‏“ ù¥ّ—¢‘م¨ ِّ¥‏¨ ©ّ،");
       gotoxy(1,10);printf("%s","   ù¥ّ¢َّّ— ü¤‏گ üَّن ¥ّ÷‏¨     ِّ‏“ ¥‏¨");
       gotoxy(1,11);printf("%s","                       ü¢َ‘ى ٌ‏گ ¤‏“ ¥ّ¢");
       gotoxy(1,12);printf("%s","¢‏ھ‘“ù¢÷¥ ٌ‘¨¢¬ ùî ô¤گّ¢‏ُگ ي¤‘“ُ‘ُھ¢َّ—");
       gotoxy(1,12);printf("%s","¥ّ¨¤ّî ü¤َ÷ّî ùَ“ ¥ّ‏ ِّ¨َّگي¤‘“ُ¥ّ¢َّّ—");
       gotoxy(29,10);cout<<s;
      }i=1;
      while(cc!=1){
		 window(25,19,35,19);textbackground(3);clrscr();cout<<"‘َّ   ‏ ";
		 window(45,19,55,19);textbackground(3);clrscr();cout<<"  ِ÷÷¢¥—";
		 if(i==1){window(20,20,60,20);textbackground(6);clrscr();cout<<"www.asgharkohi.blogfa.com";window(25,19,35,19);textbackground(4);clrscr();cout<<"‘َّ   ‏ ";}
		 if(i==2){window(20,20,60,20);textbackground(6);clrscr();cout<<"                 www.asgharkohi.blogfa.com";window(45,19,55,19);textbackground(4);clrscr();cout<<"  ِ÷÷¢¥—";}
		 cc=getch();
		 if(cc==13)
			 {
			 if(i==1){cc=1;x=100;}
			 if(i==2)cc=1;
			 }
		 if(cc==0)
			 {
			 cc=getch();
			 if(cc==75){i--;if(i==0)i=2;}
			 if(cc==77){i++;if(i==3)i=1;}
			}
	}
	cc=NULL;
	if(x!=100){window(1,1,80,25);textbackground(1);clrscr();}
   }
for(i=1;i<=40;i++){
	   window(i,1,i,25);textbackground(0);clrscr();
	   window(81-i,1,81-i,25);textbackground(0);clrscr();
	   delay(100);
   }
}