Compare commits
No commits in common. "094998cc799518b695cbec0665d1be45c7a47451" and "cbd1003ebb2e3bd5eac455dbee9aa51ad577b2bb" have entirely different histories.
094998cc79
...
cbd1003ebb
34
work1/q3.c
34
work1/q3.c
@ -4,15 +4,12 @@
|
|||||||
|
|
||||||
#define DEPOT_SIZE 10
|
#define DEPOT_SIZE 10
|
||||||
|
|
||||||
struct Bus
|
struct Bus {
|
||||||
{
|
|
||||||
int BusID;
|
int BusID;
|
||||||
int RouteID;
|
int RouteID;
|
||||||
time_t schedule;
|
time_t schedule;
|
||||||
} Depot[DEPOT_SIZE];
|
} Depot[DEPOT_SIZE];
|
||||||
|
|
||||||
typedef enum { true, false } bool;
|
|
||||||
|
|
||||||
void createBuses();
|
void createBuses();
|
||||||
void printBuses();
|
void printBuses();
|
||||||
void scheduleBuses();
|
void scheduleBuses();
|
||||||
@ -20,34 +17,11 @@ void alignupBuses();
|
|||||||
void releaseBuses();
|
void releaseBuses();
|
||||||
void emergency();
|
void emergency();
|
||||||
|
|
||||||
// utils variable
|
int main() {
|
||||||
bool has_created = false;
|
|
||||||
|
|
||||||
// utils function
|
|
||||||
print_depot(struct Bus *depot);
|
|
||||||
|
|
||||||
int main()
|
|
||||||
{
|
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
void createBuses()
|
void createBuses() {
|
||||||
{
|
// do something
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user