Download examples/sum_array_bench.c from AProver/aprover: direct link, hf CLI and curl.
- Browser
- Download file 263 Bytes
-
https://huggingface.co/spaces/AProver/aprover/resolve/main/examples/sum_array_bench.c
- Command line
-
hf download hf://spaces/AProver/aprover/examples/sum_array_bench.c
-
curl -L -o sum_array_bench.c https://huggingface.co/spaces/AProver/aprover/resolve/main/examples/sum_array_bench.c
263 Bytes
| int sumArray(int *a, int n) { | |
| int p = 0, sum = 0; | |
| while (p < n) { | |
| sum = sum + a[p]; | |
| p++; | |
| } | |
| return sum; | |
| } | |
| // write a test | |
| void main() { | |
| int arr[5] = {1, 2, 3, 4, 5}; | |
| int sum = sumArray(arr, 5); | |
| //@ assert sum == 15; | |
| } | |