Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <strings.h>
- #define MAX 30
- #define MAXM 12
- #define TAK 1
- #define NIE 0
- int czywolne();
- int pokazliczbe();
- int wysw_menu();
- struct rezer{
- int num;
- int flaga;
- char imie[MAX];
- char nazw[MAX];
- };
- int main(void)
- {
- int i;
- struct rezer wacja[12];
- struct rezer *wsk=&wacja;
- wacja[0].num=1;
- for(i=0; i<MAXM; i++){
- if(i!=0){
- wacja[i].num=wacja[i-1].num;
- wacja[i].num+=1;
- }
- else
- continue;
- }
- for(i=0; i<12; i++)
- printf("%d ", wacja[i].num);
- switch(wysw_menu())
- {
- case(1): pokazliczbe(wsk);
- break;
- //case(2):pokazpuste(wsk);
- // break;
- //case(3):pokazokna(wsk);
- //break;
- //case(4):rezerwacja(wsk);
- //break;
- case(5):printf("5");
- break;
- case(6):printf("6");
- break;
- default:printf("zleee");
- }
- return 0;
- }
- int wysw_menu()
- {
- int wybor;
- printf("Aby wybrac opcje, wpisz jej oznaczenie liczbowe:\n");
- printf("1. Pokaz liczbe pustych miejsc\n");
- printf("2: Pokaz liste pustych miejsc\n");
- printf("3: Pokaz puste miejsca przy oknach\n");
- printf("4: Zarezerwuj miejsce dla klienta\n");
- printf("5: Usun rezerwacje miejsca\n");
- printf("6: Koniec\n");
- scanf("%d", &wybor);
- return wybor;
- }
- int czywolne(wsk)
- {
- int i=0;
- for(i=0; i<12; i++)
- {
- if(wsk->flaga==0)
- return 0;
- else return 1;
- }
- }
- int pokazliczbe(wsk)
- {
- int i=0;
- int licznik=0;
- for (i=0;i<12; i++)
- {
- if(czywolne(wsk)==1)
- licznik++;
- else return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement