Download examples/sum/program.c from Angshul/CompAIler: direct link, hf CLI and curl.
- Browser
- Download file 237 Bytes
-
https://huggingface.co/spaces/Angshul/CompAIler/resolve/main/examples/sum/program.c
- Command line
-
hf download hf://spaces/Angshul/CompAIler/examples/sum/program.c
-
curl -L -o program.c https://huggingface.co/spaces/Angshul/CompAIler/resolve/main/examples/sum/program.c
237 Bytes
| int sum_to(int n) { | |
| int total = 0; | |
| for (int i = 1; i < n; ++i) total += i; | |
| return total; | |
| } | |
| int main(void) { | |
| int n; | |
| if (scanf("%d", &n) != 1) return 1; | |
| printf("%d\n", sum_to(n)); | |
| return 0; | |
| } | |