3
This commit is contained in:
parent
872a1e4875
commit
15fda00eee
10
a_station.c
10
a_station.c
@ -1,6 +1,7 @@
|
|||||||
#include "a_station.h"
|
#include "a_station.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
struct station* create_station(){
|
struct station* create_station(){
|
||||||
struct station* station = calloc(1,sizeof(struct station));
|
struct station* station = calloc(1,sizeof(struct station));
|
||||||
@ -65,10 +66,19 @@ void add_target_capacity(struct station* station,const char* target, int capacit
|
|||||||
}
|
}
|
||||||
|
|
||||||
int get_target_capacity(struct station* station,const char* target){
|
int get_target_capacity(struct station* station,const char* target){
|
||||||
|
int track = select_track(station,target);
|
||||||
|
struct car* start = station->tracks[track];
|
||||||
|
while(start->next != NULL){
|
||||||
|
if(strcmp(start->value,target)== 0){
|
||||||
|
return start->capacity;
|
||||||
|
}
|
||||||
|
start = start->next;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int count_targets(struct station* station){
|
int count_targets(struct station* station){
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user