Download code/train/C++/0000762_statistic.cpp from Variable-role/sajaniemi_variable_dataset_large: direct link, hf CLI and curl.
- Browser
- Download file 357 Bytes
-
https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/code/train/C%2B%2B/0000762_statistic.cpp
- Command line
-
hf download hf://datasets/Variable-role/sajaniemi_variable_dataset_large/code/train/C++/0000762_statistic.cpp
-
curl -L -o 0000762_statistic.cpp https://huggingface.co/datasets/Variable-role/sajaniemi_variable_dataset_large/resolve/main/code/train/C%2B%2B/0000762_statistic.cpp
357 Bytes
| using namespace std; | |
| int main() { | |
| int n = 0, mmin = INF, mmax = -INF, sum = 0; | |
| int x; | |
| while(scanf("%d", &x) == 1){ | |
| n ++; | |
| sum += x; | |
| if(x > mmax) mmax = x; | |
| if(x < mmin) mmin = x; | |
| } | |
| printf("%d %d %.3f",mmin, mmax, (double)sum / n); | |
| return 0; | |
| } |