#include<iostream>
main()
{
char movie;
printf("plese select movie\n");
printf("1.godzilla vs kong\n");
printf("2.kimetsu no yaiba the movie mugen train\n");
printf("3.Wonder women\n");
printf("4.way down\n");
printf("select movie : ");
scanf("%c",&movie);
switch(movie)
{
case '1' : printf("godzilla vs kong 200 bath\n");
break;
case '2' : printf("kimetsu no yaiba the movie mugen train 200 bath\n");
break;
case '3' : printf("Wonder women 200 bath\n");
break;
case '4' : printf("way down 200 bath\n");
}
{
char [100]ticket;
printf("how many ticket? :");
scanf("%c",&ticket);
switch(ticket)
{
case '1' : printf("200 bath\n");
break;
case '2' : printf("400 bath\n");
break;
case '3' : printf("600 bath\n");
break;
case '4' : printf("800 bath\n");
break;
case '5' : printf("1000 bath\n");
break;
case '6' : printf("1200 bath\n");
break;
case '7' : printf("1400 bath\n");
break;
case '8' : printf("1600 bath\n");
break;
case '9' : printf("1800 bath\n");
break;
case '10' : printf("2000 bath\n");
break;
}
}
}
ทำไงให้ป้อนข้อมูลได้ 2 ครั้งครับ
main()
{
char movie;
printf("plese select movie\n");
printf("1.godzilla vs kong\n");
printf("2.kimetsu no yaiba the movie mugen train\n");
printf("3.Wonder women\n");
printf("4.way down\n");
printf("select movie : ");
scanf("%c",&movie);
switch(movie)
{
case '1' : printf("godzilla vs kong 200 bath\n");
break;
case '2' : printf("kimetsu no yaiba the movie mugen train 200 bath\n");
break;
case '3' : printf("Wonder women 200 bath\n");
break;
case '4' : printf("way down 200 bath\n");
}
{
char [100]ticket;
printf("how many ticket? :");
scanf("%c",&ticket);
switch(ticket)
{
case '1' : printf("200 bath\n");
break;
case '2' : printf("400 bath\n");
break;
case '3' : printf("600 bath\n");
break;
case '4' : printf("800 bath\n");
break;
case '5' : printf("1000 bath\n");
break;
case '6' : printf("1200 bath\n");
break;
case '7' : printf("1400 bath\n");
break;
case '8' : printf("1600 bath\n");
break;
case '9' : printf("1800 bath\n");
break;
case '10' : printf("2000 bath\n");
break;
}
}
}