answer.code: In function ‘int main()’:
answer.code:14:1: error: ‘sort’ was not declared in this scope
14 | sort(a+1,a+n+1);
| ^~~~
answer.code:14:1: note: suggested alternatives:
In file included from /usr/include/c++/11/algorithm:74,
from answer.code:2:
/usr/include/c++/11/pstl/glue_algorithm_defs.h:296:1: note: ‘std::sort’
296 | sort(_ExecutionPolicy&& __exec, _RandomAccessIterator __first, _RandomAccessIterator __last);
| ^~~~
In file included from /usr/include/c++/11/algorithm:64,
from answer.code:2:
/usr/include/c++/11/bits/ranges_algo.h:1834:30: note: ‘std::ranges::sort’
1834 | inline constexpr __sort_fn sort{};
| ^~~~
answer.code:15:1: error: ‘reverse’ was not declared in this scope
15 | reverse(a+1,a+n+1);
| ^~~~~~~
answer.code:15:1: note: suggested alternatives:
In file included from /usr/include/c++/11/algorithm:74,
from answer.code:2:
/usr/include/c++/11/pstl/glue_algorithm_defs.h:249:1: note: ‘std::reverse’
249 | reverse(_ExecutionPolicy&& __exec, _BidirectionalIterator __first, _BidirectionalIterator __last);
| ^~~~~~~
In file included from /usr/include/c++/11/algorithm:64,
from answer.code:2:
/usr/include/c++/11/bits/ranges_algo.h:1325:33: note: ‘std::ranges::reverse’
1325 | inline constexpr __reverse_fn reverse{};
| ^~~~~~~
answer.code:11:6: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
11 | scanf("%hhu",&n);
| ~~~~~^~~~~~~~~~~
answer.code:13:24: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
13 | for(i=1;i<=n;i++) scanf("%hd",a+i),s+=a[i];
| ~~~~~^~~~~~~~~~~