Download benchmarks/Algorithms/integer_divide/solution.c from PV-SJTU/PV-Bench: direct link, hf CLI and curl.
- Browser
- Download file 178 Bytes
-
https://huggingface.co/datasets/PV-SJTU/PV-Bench/resolve/main/benchmarks/Algorithms/integer_divide/solution.c
- Command line
-
hf download hf://datasets/PV-SJTU/PV-Bench/benchmarks/Algorithms/integer_divide/solution.c
-
curl -L -o solution.c https://huggingface.co/datasets/PV-SJTU/PV-Bench/resolve/main/benchmarks/Algorithms/integer_divide/solution.c
178 Bytes
| void divide(int n, int *p) | |
| { | |
| int cnt = 0; | |
| for (int i = 2; i <= n; i++) { | |
| while (n % i == 0) { | |
| cnt++; | |
| p[cnt] = i; | |
| n /= i; | |
| } | |
| if (n == 1) { | |
| break; | |
| } | |
| } | |
| } | |