Sie sind auf Seite 1von 27

//-----------------------HOTEL MANAGEMENT

SYSTEM-----------------------------

//THESE ARE THE INCLUDED FILES//

#include<conio.h>
#include<stdio.h>
#include<string.h>
#include<ctype.h>
#include<fstream.h>
#include<dos.h>
#include<stdlib.h>

int no_of_cust=0;
int val_rm(int y)
{
int f=0;
do
{
if(y>31 || y<1)
{
clrscr();
gotoxy(1,25);
cout<<"ENTER ROOM NO. BETWEEN 1-30";
gotoxy(34,12);
cout<<"ENTER THE ROOM NO. ";
cin>>y;
f=1;
}
else
f=0;
} while(f==1);
return y;
}
float val_adv(float x)
{
int f=0;
do
{
if(x>500)
f=1;
else
{
gotoxy(3,17);
clreol( );
cout<<"ENTER THE ADVANCE :";
gotoxy(22,17);
cin>>x;
f=0;
}
}while(f==0);
return x;
}

class address
{
public:
int h_no;
char coln[21];
char city[21];
void ad_ini();
void get_ad(void);
void disp_ad(int c,int r);
};
class customer
{
public:
char name[21];
address addr;
struct date dt;
int rm_charge;
double charge;
char t_rm;
int rm_no;
double adv;
int x;
void get_cust(void);
void display(int c,int r);
void cust_ini();
};

class OPERATE
{
customer cust;
char pos[31];
int no_day(void);
void cust_in(void);
void cust_out(void);
void cust_order(void);
void cust_disp(void);
void list(void);
void cust_modify(void);
public:
void work(void);
void help(void);
OPERATE(void);
};
void address::ad_ini()
{
h_no=0;
for(int i=0;i<21;++i)
{
coln[i]=' ';
city[i]=' ';
}
}

void address::disp_ad(int c,int r)


{
gotoxy(c,r+1);
cout<<"ADDRESS:";
gotoxy(c+1,r+2);
cout<<"HOUSE NO : "<<h_no;
gotoxy(c+1,r+3);
cout<<"COLONY :";
puts(coln);
gotoxy(c+1,r+4);
cout<<"CITY :";
puts(city);
}

void address::get_ad(void)
{
ad_ini();
gotoxy(3,6);
cout<<"ADDRESS :-";
gotoxy(4,7);
cout<<"HOUSE NO.:";
cin>>h_no;
gotoxy(4,8);
cout<<"COLONY :";
gets(coln);
gotoxy(4,9);
cout<<"CITY :";
gets(city);
}

void customer::get_cust(void)
{
cust_ini();
++no_of_cust;
getdate(&dt);
gotoxy(3,2);
cout<<"ENTER CUSTOMER NO."<<no_of_cust<<" DETAILS ";
gotoxy(3,4);
cout<<"NAME :";
gets(name);
addr.get_ad();
gotoxy(3,11);
cout<<"ROOM TYPE : AMOUNT PER DAY";
gotoxy(3,12);
cout<<"N.NORMAL : Rs.500";
gotoxy(3,13);
cout<<"S.SEMI-DELUXE : Rs.1000";
gotoxy(3,14);
cout<<"D.DELUXE : Rs.1500";
gotoxy(3,15);
cout<<"ENTER TYPE OF ROOM(N/S/D) :";
t_rm=getch();
t_rm=toupper(t_rm);
}
void customer::display(int c,int r)
{
struct date i;
getdate(&i);
gotoxy(c,r);
cout<<"NAME :";
puts(name);
addr.disp_ad(c,r+1);
gotoxy(c,r+7); // gotoxy() present in the conio.h. It is used for
placing the cursor at a desire location on the screen.
cout<<"DATE OF COMING :";
printf("%d",dt.da_day); //printf() is the part of stdio.h for showing
formatting output
printf("-%d",dt.da_mon);
printf("-%d",dt.da_year);
gotoxy(c,r+8);
cout<<"CURRENT DATE :";
printf("%d",i.da_day);
printf("-%d",i.da_mon);
printf("-%d",i.da_year);
gotoxy(c,r+10);
switch(t_rm)
{
case 'N':cout<<"TYPE OF ROOM :NORMAL";
break;
case 'S':cout<<"TYPE OF ROOM :SEMI-DELUXE";
break;
case 'D':cout<<"TYPE OF ROOM :DELUXE";
break;
}
gotoxy(c,r+11);
cout<<"ROOM NO : "<<rm_no;
gotoxy(c,r+13);
cout<<"CHARGE PER DAY :"<<rm_charge;
gotoxy(c,r+14);
cout<<"ADVANCE PAID :"<<adv;
}
void customer::cust_ini()
{
addr.ad_ini();
for(int i=0;i<21;++i)
name[i]=' ';
charge=0;
rm_charge=0;
t_rm=' ';
rm_no=0;
adv=0;
x=0;
}

void OPERATE::cust_in(void)
{
fstream file;
file.open("HOTEL.DAT",ios::app|ios::binary);
char ch;
do
{
int i=1,f=1,r=0,p;
clrscr();
cust.get_cust();
while(f==1)
{
if(r==1)
{
gotoxy(2,25);
clreol();
cout<<"WRONG TYPE ENTERED !";
cout<<"ENTER AGAIN.";
gotoxy(30,15);
clreol();
gotoxy(30,15);
cust.t_rm=getch();
cust.t_rm=toupper(cust.t_rm);
}
if(r==2)
{
gotoxy(2,25);
clreol();
cout<<"NO ROOM VACANT OF THIS TYPE !";
cout<<"ENTER AGAIN.";
gotoxy(30,15);
clreol();
gotoxy(30,15);
cust.t_rm=getch();
cust.t_rm=toupper(cust.t_rm);
}
switch(cust.t_rm)
{
case 'N':for(i=1;i<11;++i)
{
if(pos[i]=='V')
{
pos[i]='F';
cust.rm_no=i;
cust.rm_charge=500;
f=0;
break;
}
}
if(f==1)
r=2;
break;
case 'S':for(i=11;i<21;++i)
{
if(pos[i]=='V')
{
pos[i]='F';
cust.rm_no=i;
cust.rm_charge=1000;
f=0;
break;
}
}
if(f==1)
r=2;
break;
case 'D':for(i=21;i<31;++i)
{
if(pos[i]=='V')
{
pos[i]='F';
cust.rm_no=i;
cust.rm_charge=1500;
f=0;
break;
}
}
if(f==1)
r=2;
break;
default :f=1,r=1;
}
}
gotoxy(30,15);
clreol();
switch(cust.t_rm)
{
case 'N':cout<<"NORMAL";
break;
case 'S':cout<<"SEMI-DELUXE";
break;
case 'D':cout<<"DELUXE";
break;
}
gotoxy(2,25);
clreol();
cout<<"ENTER ADVANCE GREATER THAN 500.";
gotoxy(3,17);
cout<<"ENTER THE ADVANCE :";
cin>>cust.adv;
cust.adv=val_adv(cust.adv);
gotoxy(2,25);
clreol();
p=(no_of_cust-1)*sizeof(cust);
gotoxy(3,19);
cout<<"YOU HAVE BEEN ALLOCATED ROOM NO. :"<<cust.rm_no;
getch();
file.seekp(p,ios::beg);
file.write((char*)&cust,sizeof(cust));
gotoxy(43,11);
cout<<"DO YOU WANT TO CONTINUE IT(y/n)? ";
gotoxy(43,12);
cout<<"ENTER YOUR CHOICE :";
ch=getch();
}while(ch=='y' || ch=='Y');
file.close();
}

void OPERATE::cust_out(void)
{
clrscr();
struct date s;
getdate(&s);
int x,i=1;
char r;
fstream f,file;
file.open("HOTEL.DAT",ios::in|ios::binary);
gotoxy(34,12);
cout<<"ENTER THE ROOM NO :";
cin>>x;
x=val_rm(x);
if(pos[x]=='V')
{
clrscr();
gotoxy(35,13);
cout<<"ROOM VACANT !";
getch();
return;
}
int flag=0;
file.seekg(0);
for(;i<=no_of_cust;++i)
{
file.read((char*)&cust,sizeof(cust));
if(cust.rm_no==x)
{
clrscr();
gotoxy(3,3);
cout<<"YOU ARE LEAVEING CUSTOMER NO."<<i;
cust.display(3,5);
gotoxy(3,20);
cout<<"CHARGE :"
<<cust.charge+(no_day()-cust.x)*cust.rm_charge;
gotoxy(43,11);
cout<<"ARE YOU SURE ?";
gotoxy(43,12);
cout<<"ENTER YOUR CHOICE(Y/N) :";
r=getch();
if(r=='y' || r=='Y')
{ flag=1;
--no_of_cust;
pos[cust.rm_no]='V';
clrscr();
gotoxy(3,2);
cout<<"CUSTOMER WITH DETAILS OUT :";
cust.display(3,4);
gotoxy(4,20);
double p;
p=(no_day()-cust.x)*cust.rm_charge+cust.charge-cust.adv;
if(p>0)
cout<<"TOTAL AMOUNT TO BE PAID :"<<p;
else
cout<<"AMOUNT TO BE PAID BY US :"<<(-1)*p;
getch();
break;
}
}
}
if(flag==1)
{
f.open("TEMP.DAT",ios::out|ios::binary);
f.seekp(0);
file.seekg(0);
for(i=1;i<=(no_of_cust+1);++i)
{
file.read((char*)&cust,sizeof(cust));
if(cust.rm_no!=x)
{
f.write((char*)&cust,sizeof(cust));
}
}
f.close();
remove("HOTEL.DAT");
rename("TEMP.DAT","HOTEL.DAT");
}
file.close();
}

void OPERATE::cust_order(void)
{
clrscr();
float a,b,c,d,x;
int y,i;
fstream file,f;
file.open("HOTEL.DAT",ios::in|ios::binary);
gotoxy(34,11);
cout<<"ENTER THE ROOM NO. :";
cin>>y;
y=val_rm(y);
if(pos[y]=='V')
{
clrscr();
gotoxy(35,13);
cout<<"ROOM VACANT !";
getch();
return;
}
f.open("TEMP.DAT",ios::out|ios::binary);
gotoxy(2,25);
cout<<"ENTER AMOUNT GREATER THAN 0 ";
gotoxy(34,13);
cout<<"ENTER FOOD BILL :";
cin>>a;
gotoxy(34,15);
cout<<"ENTER LAUNDARY BILL :";
cin>>b;
gotoxy(34,17);
cout<<"ENTER MINI BAR BILL :";
cin>>c;
gotoxy(34,19);
cout<<"ENTER ROOM SERVICE CHARGES :";
cin>>d;
gotoxy(30,21);
x=a+b+c+d;
cout<<"-------------------------------------------";
gotoxy(30,22);
cout<<"TOTAL AMOUNT ADDED TO CUSTOMERS
BILL :"<<x;
gotoxy(30,23);
cout<<"-------------------------------------------";
getch();
int g=0;
do
{
if(x>0.0)
g=1;
else
{
gotoxy(34,13);
clreol();
cout<<"ENTER FOOD BILL :";
cin>>a;
gotoxy(34,15);
cout<<"ENTER LAUNDARY BILL :";
cin>>b;
gotoxy(34,17);
cout<<"ENTER MINI BAR BILL :";
cin>>c;
gotoxy(34,19);
cout<<"ENTER ROOM SERVICE CHARGES :";
cin>>d;
gotoxy(30,21);
x=a+b+c+d;
cout<<"-------------------------------------------";
gotoxy(30,22);
cout<<"TOTAL AMOUNT ADDED TO CUSTOMERS
BILL :"<<x;
gotoxy(30,23);
cout<<"-------------------------------------------";
getch();
g=0;
}
}while(g==0);
file.seekg(0);
f.seekp(0);
for(i=1;i<=no_of_cust;++i)
{
file.read((char*)&cust,sizeof(cust));
if(cust.rm_no==y)
{
cust.charge+=x;
f.write((char*)&cust,sizeof(cust));
}
else
f.write((char*)&cust,sizeof(cust));
}
f.close();
remove("HOTEL.DAT");
rename("TEMP.DAT","HOTEL.DAT");
file.close();
}

void OPERATE::cust_disp(void)
{
int x,i=1;
clrscr();
fstream file;
file.open("HOTEL.DAT",ios::in|ios::binary);
gotoxy(34,12);
cout<<"ENTER THE ROOM NO. :";
cin>>x;
x=val_rm(x);
if(pos[x]=='V')
{
clrscr();
gotoxy(35,13);
cout<<"ROOM VACANT !";
getch();
return;
}
file.seekg(0);
for(;i<=no_of_cust;++i)
{
file.read((char*)&cust,sizeof(cust));
if(cust.rm_no==x)
{
clrscr();
gotoxy(3,2);
cout<<"DETAILS OF CUSTOMER NO."<<i;
cust.display(3,4);
gotoxy(3,19);
cout<<"CHARGE TILL NOW :"
<<cust.charge+(no_day()-cust.x)*cust.rm_charge;
getch();
break;
}
}
file.close();
}

void OPERATE::list(void)
{
fstream file;
file.open("HOTEL.DAT",ios::in|ios::binary);
if(no_of_cust==0)
{
clrscr();
gotoxy(35,13);
cout<<"LIST EMPTY!";
getch();
return;
}
file.seekg(0);
for(int i=1;i<=no_of_cust;++i)
{
file.read((char*)&cust,sizeof(cust));
if(i%2==0)
{
gotoxy(42,2);
cout<<"CUSTOMER NO."<<i;
cust.display(42,4);
gotoxy(42,19);
cout<<"CHARGE :"
<<cust.charge+(no_day()-cust.x)*cust.rm_charge;
gotoxy(2,25);
clreol();
if(i==no_of_cust)
cout<<"LIST OVER ! PRESS ANY KEY TO CONTINUE ";
else
cout<<"PRESS ANY KEY TO CONTINUE ";
getch();
}
else
{
clrscr();
gotoxy(3,2);
cout<<"CUSTOMER NO."<<i;
cust.display(3,4);
gotoxy(3,19);
cout<<"CHARGE :"
<<cust.charge+(no_day()-cust.x)*cust.rm_charge;
if(i==no_of_cust)
{
gotoxy(2,25);
clreol();
cout<<"LIST OVER!";
cout<<"PRESS ANY KEY TO CONTINUE ";
getch();
}
}
}
file.close();
}

void OPERATE::cust_modify(void)
{
int x,i=1;
struct date p;
getdate(&p);
clrscr();
customer c;
c.cust_ini();
fstream file,l;
file.open("HOTEL.DAT",ios::in|ios::binary);
gotoxy(34,12);
cout<<"ENTER THE ROOM NO :";
cin>>x;
x=val_rm(x);
if(pos[x]=='V')
{
clrscr();
gotoxy(35,13);
cout<<"ROOM VACANT !";
getch();
return;
}
file.seekg(0);
for(i=0;i<=no_of_cust;++i)
{
file.read((char*)&cust,sizeof(cust));
if(cust.rm_no==x)
{
char ch;
clrscr();
gotoxy(3,2);
cout<<"DETAILS OF CUSTOMER NO. :"<<i;
cust.display(3,4);
gotoxy(3,19);
cout<<"CHARGE TILL NOW :"<<cust.charge+(no_day()-
cust.x)*cust.rm_charge;
gotoxy(43,11);
cout<<"DO YOU WANT TO MODIFY RECORD ?";
gotoxy(43,12);
cout<<"ENTER YOUR CHOICE(y/n):";
ch=getch();
if(ch=='y'||ch=='Y')
{
clrscr();
gotoxy(11,2);
cout<<"PREVIOUS RECORD";
gotoxy(47,2);
cout<<"RECORD FOR MODIFICATION";
gotoxy(33,1);
cout<<"CUSTOMER NO."<<i;
cust.display(3,5);
gotoxy(3,20);
cout<<"CHARGE :"
<<cust.charge+(no_day()-cust.x)*cust.rm_charge;
c=cust;
gotoxy(42,5);
cout<<"NAME :";
puts(c.name);
gotoxy(42,7);
cout<<"ADDRESS :";
gotoxy(43,8);
cout<<"HOUSE NO :";
gotoxy(2,25);
cout<<"PRESS 0 FOR SAME :";
gotoxy(53,8);
cin>>c.addr.h_no;
if(c.addr.h_no==0)
{
c.addr.h_no=cust.addr.h_no;
}
gotoxy(53,8);
clreol();
cout<<c.addr.h_no;
gotoxy(2,25);
clreol();
cout<<"JUST PRESS ENTER FOR SAME ";
gotoxy(43,9);
cout<<"COLONY :";
gotoxy(53,9);
gets(c.addr.coln);
if(strlen(c.addr.coln)==0)
{
for(int i=0;cust.addr.coln[i]!='0';++i)
c.addr.coln[i]=cust.addr.coln[i];
}
gotoxy(53,9);
clreol();
puts(c.addr.coln);
gotoxy(43,10);
cout<<"CITY :";
gotoxy(53,10);
gets(c.addr.city);
if(strlen(c.addr.city)==0)
{
for(int i=0;cust.addr.city[i]!='0';++i)
c.addr.city[i]=cust.addr.city[i];
}
gotoxy(53,10);
clreol();
puts(c.addr.city);
gotoxy(42,12);
cout<<"DATE OF COMING :";
printf("%d",cust.dt.da_day);
printf("-%d",cust.dt.da_mon);
printf("-%d",cust.dt.da_year);
gotoxy(42,13);
cout<<"CURRENT DATE :";
printf("%d",p.da_day);
printf("-%d",p.da_mon);
printf("-%d",p.da_year);
gotoxy(42,15);
cout<<"TYPE OF ROOM :";
gotoxy(2,25);
clreol();
cout<<"N.NORMAL/500 S.SEMI-DELUXE/1000
D.DELUXE/1500 ";
gotoxy(56,15);
c.t_rm=getch();
c.t_rm=toupper(c.t_rm);
int f=1,r=0;
while(f==1)
{
if(r==1)
{
gotoxy(49,25);
clreol();
cout<<"WRONG TYPE ENTERED ! ENTER
AGAIN.";
gotoxy(42,15);
clreol();
gotoxy(42,15);
cout<<"TYPE OF ROOM :";
gotoxy(56,15);
c.t_rm=getch();
c.t_rm=toupper(c.t_rm);
}
if(r==2)
{
gotoxy(49,25);
clreol();
cout<<"NO ROOM VACANT OF THIS TYPE !";
gotoxy(42,15);
clreol();
gotoxy(42,15);
cout<<"TYPE OF ROOM :";
gotoxy(56,15);
c.t_rm=getch();
c.t_rm=toupper(c.t_rm);
}
switch(c.t_rm)
{
case 'N':for(i=1;i<11;++i)
{
if(pos[i]=='V'&&i!=cust.rm_no)
{
pos[i]='F';
pos[c.rm_no]='V';
c.charge+=(no_day()-c.x)*c.rm_charge;
if(c.t_rm==cust.t_rm)
c.x=no_day();
else
c.x=no_day()-1;
c.rm_no=i;
c.rm_charge=500;
f=0;
break;
}
}
if(f==1)
r=2;
break;
case 'S':for(i=11;i<21;++i)
{
if(pos[i]=='V'&&i!=cust.rm_no)
{
pos[i]='F';
pos[c.rm_no]='V';
c.charge+=(no_day()-c.x)*c.rm_charge;
if(c.t_rm==cust.t_rm)
c.x=no_day();
else
c.x=no_day()-1;
c.rm_no=i;
c.rm_charge=1000;
f=0;
break;
}
}
if(f==1)
r=2;
break;
case 'D':for(i=21;i<31;++i)
{
if(pos[i]=='V'&&i!=cust.rm_no)
{
pos[i]='F';
pos[c.rm_no]='V';
c.charge+=(no_day()-c.x)*c.rm_charge;
if(c.t_rm==cust.t_rm)
c.x=no_day();
else
c.x=no_day()-1;
c.rm_no=i;
c.rm_charge=1500;
f=0;
break;
}
}
if(f==1)
r=2;
break;
default:f=1;r=1;
}
}
gotoxy(2,25);
clreol();
gotoxy(56,15);
clreol();
switch(c.t_rm)
{
case 'N':cout<<"NORMAL";
break;
case 'S':cout<<"SEMI-DELUXE";
break;
case 'D':cout<<"DELUXE";
break;
}
gotoxy(42,16);
cout<<"ROOM NO :";
cout<<c.rm_no;
gotoxy(42,18);
cout<<"CHARGE PER DAY :";
cout<<c.rm_charge;
gotoxy(42,19);
cout<<"ADVANCE PAID :";
cout<<c.adv;
gotoxy(42,20);
cout<<"CHARGE :";
cout<<c.charge+(no_day()-c.x)*c.rm_charge;
l.open("TEMP.DAT",ios::out|ios::binary);
file.seekg(0);
l.seekp(0);
for(int i=1;i<=no_of_cust;++i)
{
file.read((char*)&cust,sizeof(cust));
if(cust.rm_no==x)
{
l.write((char*)&c,sizeof(c));
}
else
l.write((char*)&cust,sizeof(cust));
}
l.close();
remove("HOTEL.DAT");
rename("TEMP.DAT","HOTEL.DAT");
getch();
break;
}
}
}
file.close();
}

void OPERATE::work()
{
char n;
clrscr();
do
{ clrscr();
gotoxy(36,7);
cout<<"MENU";
gotoxy(30,8);
cout<<"1.CUSTOMER IN ";
gotoxy(30,9);
cout<<"2.CUSTOMER OUT";
gotoxy(30,10);
cout<<"3.ORDER";
gotoxy(30,11);
cout<<"4.DISPLAY CUSTOMER";
gotoxy(30,12);
cout<<"5.LIST";
gotoxy(30,13);
cout<<"6.MODIFY";
gotoxy(30,14);
cout<<"7.HELP";
gotoxy(30,15);
cout<<"0.EXIT";
gotoxy(30,16);
cout<<"ENTER YOUR CHOICE :";
gotoxy(49,16);
cin>>n;
switch(n)
{
case '1':cust_in();
break;
case '2':cust_out();
break;
case '3':cust_order();
break;
case '4':cust_disp();
break;
case '5':list();
break;
case '6':cust_modify();
break;
case '7': help();
break;
case '0':exit(0);
break;
default:gotoxy(2,25);
cout<<"Invaild Choice Enter Again.......!!";
}
}while(n!='0');
}

void OPERATE::help()
{
clrscr();
gotoxy(4,1);
cout<<"This software is designed by team of AKSHAY";
gotoxy(3,2);
cout<<"This basically works for a HOTEL in which the MENU consists
of:-";
gotoxy(3,3);
cout<<"1.CUSTOMER IN which includes :--";
gotoxy(12,4);
cout<<"Name of the customer";
gotoxy(12,5);
cout<<"Customer's address which includes --";
gotoxy(24,6);
cout<<"house number";
gotoxy(24,7);
cout<<"colony";
gotoxy(24,8);
cout<<"city";
gotoxy(12,9);
cout<<"The type of room the customer wants to have and";
gotoxy(12,10);
cout<<"Inputs the advanced which the customer will give.(more than
Rs.500)";
gotoxy(3,11);
cout<<"2.CUSTOMER OUT which ";
gotoxy(12,12);
cout<<"Inputs the room number allocated to the customer,";
gotoxy(12,13);
cout<<"And then display the full details of the customer including--";
gotoxy(15,14);
cout<<" Name,Address,Date of coming,Current Date And Total Charges.";
gotoxy(3,15);
cout<<"3.ORDER which inputs the room no and the amount for different
orders";
gotoxy(3,16);
cout<<"4.DISPLAY which inputs the room no and";
gotoxy(12,17);
cout<<"Then display the details of the associated customer of that room.";
gotoxy(3,18);
cout<<"5.LIST which display details of all the customers in the hotel till
that time.";
gotoxy(3,19);
cout<<"6.MODIFY which modifies the details of that customer as per user's
choice.";
gotoxy(3,20);
cout<<"0.FOR EXIT that is for signing off.";
gotoxy(20,22);
cout<<"This is all about our project.";
gotoxy(6,25);
cout<<"Press any key to continue .........";
getch();
}

OPERATE::OPERATE(void)
{
ifstream f;
f.open("HOTEL.DAT",ios::in|ios::binary);
f.seekg(0);
while(f.read((char *)&cust,sizeof(cust)))
{
pos[cust.rm_no]='F';
++no_of_cust;
}
for(int i=1;i<31;++i)
if(pos[i]!='F')
pos[i]='V';
f.close();
}

int OPERATE::no_day(void)
{
int n=0;
struct date d;
getdate(&d);
int a[13]={0,31,29,31,30,31,30,31,31,30,31,30,31};
if(d.da_mon==cust.dt.da_mon)
n=d.da_day-cust.dt.da_day+1;
else
{
for(int i=cust.dt.da_mon;i<=d.da_mon;++i)
{
if(i==cust.dt.da_mon)
n+=(a[i]-cust.dt.da_day+1);
else
{
if(i==d.da_mon)
n+=d.da_day;
else
n+=a[i];
}
}
}
return n;
}
int main()
{
OPERATE s;
s.work();
return 0;
}

Das könnte Ihnen auch gefallen