sbn.cassigment/work1/q3.c

53 lines
910 B
C
Raw Normal View History

2020-08-03 13:22:48 +07:00
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
2020-08-03 13:36:14 +07:00
#define DEPOT_SIZE 10
2020-08-03 14:58:28 +07:00
struct Bus
{
2020-08-03 13:22:48 +07:00
int BusID;
int RouteID;
time_t schedule;
2020-08-03 13:36:14 +07:00
} Depot[DEPOT_SIZE];
2020-08-03 14:58:28 +07:00
typedef enum { true, false } bool;
2020-08-03 13:36:14 +07:00
void createBuses();
void printBuses();
void scheduleBuses();
void alignupBuses();
void releaseBuses();
void emergency();
2020-08-03 13:22:48 +07:00
2020-08-03 14:58:28 +07:00
// utils variable
bool has_created = false;
// utils function
print_depot(struct Bus *depot);
2020-08-03 13:22:48 +07:00
2020-08-03 14:58:28 +07:00
int main()
{
2020-08-03 13:22:48 +07:00
return EXIT_SUCCESS;
2020-08-03 13:36:14 +07:00
}
2020-08-03 14:58:28 +07:00
void createBuses()
{
for (int i = 0; i < DEPOT_SIZE; i++)
{
Depot[i].BusID = i + 1;
Depot[i].RouteID = 1000 + (i + i);
}
has_created = true;
}
print_depot(struct Bus *depot) {
int size = sizeof(depot) / sizeof(depot[0]);
printf("\n Depost size: %d", size);
for (int i = 0; i < size; i++) {
printf("Bus ID: %d\n", depot[i].BusID);
printf("Route ID: %d\n", depot[i].RouteID);
}
2020-08-03 13:22:48 +07:00
}