#include "stdio.h"
main()
{
system("mode 62,50");
system("COLOR 61");
char name[10],lastname[20] ;
int mp ;
int a=300,b=600,c=900,d=500,e=1000,f=1500 ;
char choice ;
int x=100,sum,n ;
char t='Y';
while (t=='Y')
{
printf("\n^-^-^-^-^-^-^-^-^-^-^-^^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^\n");
printf(" WHAT IS YOU NAME ?\n=>");
scanf("%s",&name);
printf(" WHAT IS YOU LASTNAME ?\n=>");
scanf("%s",&lastname);
printf("--------------------------------------------------------------\n");
printf("==============================================================\n");
printf("\t \t HELLO %s %s \n",name,lastname);
printf("\t \t WELLCOME TO ME&YOU HOTEL \n");
printf("==============================================================\n");
printf("--------------------------------------------------------------\n");
printf(" HOW MANY PEOPLE ?\n=>");
scanf("%d",&mp);
printf(" HOW MANY DAY ?\n=>");
scanf("%d",&n);
if(mp==1)
{
printf("--------------------------------------------------------------\n");
printf("\t \t ROOM FOR 1 PERSON \n");
printf("--------------------------------------------------------------\n");
printf("\t 1: 1 SMALL BED = %d BATH / DAY\n",a);
printf("\t 2: 2 SMALL BEDS = %d BATH / DAY\n",b);
printf("\t 3: 3 SMALL BEDS = %d BATH / DAY\n",c);
printf("\t 4: 1 DOUBLE BED = %d BATH / DAY\n",d);
printf("\t 5: 2 DOUBLE BEDS = %d BATH / DAY\n",e);
printf("\t 6: 3 DOUBLE BEDS = %d BATH / DAY\n",f);
printf("--------------------------------------------------------------\n");
printf(" YOUR ROOM =>");
choice=getche();
printf("\n\n");
switch(choice)
{
case '1' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",a*n);
break;
case '2' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",b*n);
break;
case '3' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",c*n);
break;
case '4' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",d*n);
break;
case '5' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",e*n);
break;
case '6' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",f*n);
break;
default: printf("NOT SELECTED AND EXIT");
};
getch();
}
else if(mp==2)
{
printf("--------------------------------------------------------------\n");
printf("\t \t ROOM FOR 2 PERSONS \n");
printf("--------------------------------------------------------------\n");
printf("\t 1: 1 SMALL BED = %d BATH / DAY\n",a);
printf("\t 2: 2 SMALL BEDS = %d BATH / DAY\n",b);
printf("\t 3: 3 SMALL BEDS = %d BATH / DAY\n",c);
printf("\t 4: 1 DOUBLE BED = %d BATH / DAY\n",d);
printf("\t 5: 2 DOUBLE BEDS = %d BATH / DAY\n",e);
printf("\t 6: 3 DOUBLE BEDS = %d BATH / DAY\n",f);
printf("--------------------------------------------------------------\n");
printf(" YOUR ROOM =>");
choice=getche();
printf("\n\n");
switch(choice)
{
case '1' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",a*n);
break;
case '2' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",b*n);
break;
case '3' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",c*n);
break;
case '4' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",d*n);
break;
case '5' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",e*n);
break;
case '6' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",f*n);
break;
default: printf("NOT SELECTED AND EXIT");
};
getch();
}
else if(mp==3)
{
printf("--------------------------------------------------------------\n");
printf("\t \t ROOM FOR 3 PERSONS \n");
printf("--------------------------------------------------------------\n");
printf("\t 1: 1 SMALL BED = %d BATH / DAY\n",a);
printf("\t 2: 2 SMALL BEDS = %d BATH / DAY\n",b);
printf("\t 3: 3 SMALL BEDS = %d BATH / DAY\n",c);
printf("\t 4: 1 DOUBLE BED = %d BATH / DAY\n",d);
printf("\t 5: 2 DOUBLE BEDS = %d BATH / DAY\n",e);
printf("\t 6: 3 DOUBLE BEDS = %d BATH / DAY\n",f);
printf("--------------------------------------------------------------\n");
printf(" YOUR ROOM =>");
choice=getche();
printf("\n\n");
switch(choice)
{
case '1' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",a*n);
break;
case '2' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",b*n);
break;
case '3' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",c*n);
break;
case '4' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",d*n);
break;
case '5' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",e*n);
break;
case '6' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",f*n);
break;
default: printf("NOT SELECTED AND EXIT");
};
getch();
}
else if(mp==4)
{
printf("--------------------------------------------------------------\n");
printf("\t \t ROOM FOR 4 PERSONS \n");
printf("--------------------------------------------------------------\n");
printf("\t 1: 1 SMALL BED = %d BATH / DAY\n",a);
printf("\t 2: 2 SMALL BEDS = %d BATH / DAY\n",b);
printf("\t 3: 3 SMALL BEDS = %d BATH / DAY\n",c);
printf("\t 4: 1 DOUBLE BED = %d BATH / DAY\n",d);
printf("\t 5: 2 DOUBLE BEDS = %d BATH / DAY\n",e);
printf("\t 6: 3 DOUBLE BEDS = %d BATH / DAY\n",f);
printf("--------------------------------------------------------------\n");
printf(" YOUR ROOM =>");
choice=getche();
printf("\n\n");
switch(choice)
{
case '1' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",a*n);
break;
case '2' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",b*n);
break;
case '3' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",c*n);
break;
case '4' : printf("NAME =>%s \n",name);
printf("L
ช่วยดูโปรแกรมผมทีครับ มันรันไม่ได้
main()
{
system("mode 62,50");
system("COLOR 61");
char name[10],lastname[20] ;
int mp ;
int a=300,b=600,c=900,d=500,e=1000,f=1500 ;
char choice ;
int x=100,sum,n ;
char t='Y';
while (t=='Y')
{
printf("\n^-^-^-^-^-^-^-^-^-^-^-^^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^-^\n");
printf(" WHAT IS YOU NAME ?\n=>");
scanf("%s",&name);
printf(" WHAT IS YOU LASTNAME ?\n=>");
scanf("%s",&lastname);
printf("--------------------------------------------------------------\n");
printf("==============================================================\n");
printf("\t \t HELLO %s %s \n",name,lastname);
printf("\t \t WELLCOME TO ME&YOU HOTEL \n");
printf("==============================================================\n");
printf("--------------------------------------------------------------\n");
printf(" HOW MANY PEOPLE ?\n=>");
scanf("%d",&mp);
printf(" HOW MANY DAY ?\n=>");
scanf("%d",&n);
if(mp==1)
{
printf("--------------------------------------------------------------\n");
printf("\t \t ROOM FOR 1 PERSON \n");
printf("--------------------------------------------------------------\n");
printf("\t 1: 1 SMALL BED = %d BATH / DAY\n",a);
printf("\t 2: 2 SMALL BEDS = %d BATH / DAY\n",b);
printf("\t 3: 3 SMALL BEDS = %d BATH / DAY\n",c);
printf("\t 4: 1 DOUBLE BED = %d BATH / DAY\n",d);
printf("\t 5: 2 DOUBLE BEDS = %d BATH / DAY\n",e);
printf("\t 6: 3 DOUBLE BEDS = %d BATH / DAY\n",f);
printf("--------------------------------------------------------------\n");
printf(" YOUR ROOM =>");
choice=getche();
printf("\n\n");
switch(choice)
{
case '1' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",a*n);
break;
case '2' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",b*n);
break;
case '3' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",c*n);
break;
case '4' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",d*n);
break;
case '5' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",e*n);
break;
case '6' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",f*n);
break;
default: printf("NOT SELECTED AND EXIT");
};
getch();
}
else if(mp==2)
{
printf("--------------------------------------------------------------\n");
printf("\t \t ROOM FOR 2 PERSONS \n");
printf("--------------------------------------------------------------\n");
printf("\t 1: 1 SMALL BED = %d BATH / DAY\n",a);
printf("\t 2: 2 SMALL BEDS = %d BATH / DAY\n",b);
printf("\t 3: 3 SMALL BEDS = %d BATH / DAY\n",c);
printf("\t 4: 1 DOUBLE BED = %d BATH / DAY\n",d);
printf("\t 5: 2 DOUBLE BEDS = %d BATH / DAY\n",e);
printf("\t 6: 3 DOUBLE BEDS = %d BATH / DAY\n",f);
printf("--------------------------------------------------------------\n");
printf(" YOUR ROOM =>");
choice=getche();
printf("\n\n");
switch(choice)
{
case '1' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",a*n);
break;
case '2' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",b*n);
break;
case '3' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",c*n);
break;
case '4' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",d*n);
break;
case '5' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",e*n);
break;
case '6' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",f*n);
break;
default: printf("NOT SELECTED AND EXIT");
};
getch();
}
else if(mp==3)
{
printf("--------------------------------------------------------------\n");
printf("\t \t ROOM FOR 3 PERSONS \n");
printf("--------------------------------------------------------------\n");
printf("\t 1: 1 SMALL BED = %d BATH / DAY\n",a);
printf("\t 2: 2 SMALL BEDS = %d BATH / DAY\n",b);
printf("\t 3: 3 SMALL BEDS = %d BATH / DAY\n",c);
printf("\t 4: 1 DOUBLE BED = %d BATH / DAY\n",d);
printf("\t 5: 2 DOUBLE BEDS = %d BATH / DAY\n",e);
printf("\t 6: 3 DOUBLE BEDS = %d BATH / DAY\n",f);
printf("--------------------------------------------------------------\n");
printf(" YOUR ROOM =>");
choice=getche();
printf("\n\n");
switch(choice)
{
case '1' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",a*n);
break;
case '2' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",b*n);
break;
case '3' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",c*n);
break;
case '4' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",d*n);
break;
case '5' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",e*n);
break;
case '6' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",f*n);
break;
default: printf("NOT SELECTED AND EXIT");
};
getch();
}
else if(mp==4)
{
printf("--------------------------------------------------------------\n");
printf("\t \t ROOM FOR 4 PERSONS \n");
printf("--------------------------------------------------------------\n");
printf("\t 1: 1 SMALL BED = %d BATH / DAY\n",a);
printf("\t 2: 2 SMALL BEDS = %d BATH / DAY\n",b);
printf("\t 3: 3 SMALL BEDS = %d BATH / DAY\n",c);
printf("\t 4: 1 DOUBLE BED = %d BATH / DAY\n",d);
printf("\t 5: 2 DOUBLE BEDS = %d BATH / DAY\n",e);
printf("\t 6: 3 DOUBLE BEDS = %d BATH / DAY\n",f);
printf("--------------------------------------------------------------\n");
printf(" YOUR ROOM =>");
choice=getche();
printf("\n\n");
switch(choice)
{
case '1' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",a*n);
break;
case '2' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",b*n);
break;
case '3' : printf("NAME =>%s \n",name);
printf("LASTNAME =>%s \n",lastname);
printf("PEOPLE =>%d \n",mp);
printf("DAY =>%d \n",n);
printf("PAY IS = %d BATH \n",c*n);
break;
case '4' : printf("NAME =>%s \n",name);
printf("L