rnrjs
This commit is contained in:
parent
8bd0ab5c62
commit
f6ab3ecefd
@ -30,10 +30,7 @@ struct tree* read_tree(){
|
||||
if(!r) {
|
||||
return NULL;
|
||||
}
|
||||
buffer[strcspn(r, "\n")] = '\0';
|
||||
if(buffer[0] == '\0'){
|
||||
return NULL;
|
||||
}
|
||||
buffer[strcspn(buffer, "\n")] = '\0';
|
||||
struct tree* node = calloc(1,sizeof(struct tree));
|
||||
memcpy(node->value,buffer,SIZE);
|
||||
if(buffer[0] == '*'){
|
||||
@ -76,17 +73,15 @@ int main(void){
|
||||
struct tree* tree = read_tree();
|
||||
char line[SIZE];
|
||||
|
||||
|
||||
while( fgets(line, sizeof(line), stdin)){
|
||||
if(strcmp(line, "\n") == 0){
|
||||
whitespace = true;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
int numOfLeaves = count_leaves(tree);
|
||||
char answer[SIZE];
|
||||
bool exs = false;
|
||||
while (fgets(line, sizeof(line), stdin)) {
|
||||
line[strcspn(line, "\n")] = '\0';
|
||||
if (line[0] == '\0') {
|
||||
whitespace = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
printf("Expert z bufetu to vie.\n");
|
||||
if(!tree || !whitespace){
|
||||
printf("Chybna databaza\n");
|
||||
|
||||
Loading…
Reference in New Issue
Block a user