-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
35 lines (24 loc) · 660 Bytes
/
Copy pathmain.cpp
File metadata and controls
35 lines (24 loc) · 660 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "hash_table.h"
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int main ()
{
struct hash_table table = {};
int answers = 0, len = 0;
char* buffer = 0;
table_ctor(&table);
scanf("%d", &answers);
scanf("%d\n", &len);
buffer = (char*)calloc(len + 1, sizeof(char));
for (int i = 0; i < len; i++)
scanf("%c", &buffer[i]);
work_with_table(&table, buffer, fill);
scanf("%d\n", &len);
free(buffer);
buffer = (char*)calloc(len + 1, sizeof(char));
for (int i = 0; i < len; i++)
scanf("%c", &buffer[i]);
work_with_table(&table, buffer, find);
free(buffer);
}