Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #define seat 10
- int main()
- {
- int customer[seat] = { 0 };
- char a = 0;
- int b, i;
- printf("좌석을 예약하시겠습니까?(y 또는 n) ");
- scanf("%c", &a);
- if (a == 'n')
- printf("종료 되었습니다.\n");
- else if (a == 'y') {
- printf("----------------------------\n");
- for (i = 1; i <= seat; ++i)
- printf("%d ", i);
- printf("\n----------------------------\n");
- for (i = 0; i < seat; ++i)
- printf("%d ", customer[i]);
- printf("\n");
- printf("몇번째 좌석을 예약하시겠습니까? ");
- scanf("%d", &b);
- customer[b-1] = 1;
- printf("예약되었습니다.\n");
- for (i = 0; i < seat; ++i)
- printf("%d ", customer[seat]);
- printf("\n");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement