segments.cpp: In function 'int main()':
segments.cpp:26:18: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=]
26 | printf("%d ", pref[i]);
| ~^ ~~~~~~~
| | |
| int long long int
| %lld
segments.cpp:21:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
21 | freopen("in.txt", "r", stdin);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
segments.cpp:22:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
22 | scanf("%d", &n);
| ~~~~~^~~~~~~~~~
segments.cpp:24:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
24 | scanf("%d", &a[i]);
| ~~~~~^~~~~~~~~~~~~