Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main() {
- srand(time(0));
- int N;
- char X;
- FILE* fp = fopen("inlab01.txt", "r");
- if (fp == NULL)
- return -1;
- fscanf(fp, "%d %c", &N, &X);
- fclose(fp);
- ///////
- clock_t begin, end;
- double time_spent;
- begin = clock();
- ///////
- struktura ** tab = Losowanie(N);
- Sortowanie(tab, N);
- for (int i = 0; i < 20; i++) {
- printf("%d.\t%d\t%c\t%.2f \n", i + 1, tab[i]->id, tab[i]->znak, tab[i]->liczba);
- }
- Zliczanie(tab, N, X);
- Kasowanie(tab, N);
- ///////
- end = clock();
- time_spent = (double)(end - begin) / CLOCKS_PER_SEC;
- printf("\n \n");
- printf("Czas trwania programu: %f", time_spent);
- printf("\n");
- getchar();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement