Problem descsort
User ToiletBrIcker
Submission Time 2024-06-19 09:35:01
Score 0
Max Time N/A
Max Memory N/A

Compile Error

descsort.cpp: In function ‘int main()’:
descsort.cpp:9:22: error: ‘n’ was not declared in this scope
9 | for (int i = 0; i < n - 1; i++)
| ^
descsort.cpp:11:29: error: ‘swap’ was not declared in this scope
11 | if (arr[j] < arr[j + 1]) swap(arr[j], arr[j + 1]);
| ^~~~
descsort.cpp:11:29: note: suggested alternatives:
In file included from /usr/include/c++/9/string:55,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from descsort.cpp:1:
/usr/include/c++/9/bits/basic_string.h:6381:5: note: ‘std::swap’
6381 | swap(basic_string<_CharT, _Traits, _Alloc>& __lhs,
| ^~~~
In file included from