Download benchmarks/Data_structures/stack/solution.c from PV-SJTU/PV-Bench: direct link, hf CLI and curl.
- Browser
- Download file 256 Bytes
-
https://huggingface.co/datasets/PV-SJTU/PV-Bench/resolve/main/benchmarks/Data_structures/stack/solution.c
- Command line
-
hf download hf://datasets/PV-SJTU/PV-Bench/benchmarks/Data_structures/stack/solution.c
-
curl -L -o solution.c https://huggingface.co/datasets/PV-SJTU/PV-Bench/resolve/main/benchmarks/Data_structures/stack/solution.c
256 Bytes
| void push(int *stack, int n, int x) | |
| { | |
| stack[n] = x; | |
| } | |
| int pop(int *stack, int n) | |
| { | |
| int ret = stack[n - 1]; | |
| return ret; | |
| } | |
| void build(int *stack, int n) | |
| { | |
| for (int i = 1; i < n; ++i) { | |
| int x = stack[i]; | |
| push(stack, i, x); | |
| } | |
| } | |