Problem potatosalad
User Armnotsostrong123456
Submission Time 2025-04-12 09:37:57
Score 0
Max Time N/A
Max Memory N/A

Compile Error

potatosalad.cpp: In function ‘int main()’:
potatosalad.cpp:6:5: error: ‘cin’ was not declared in this scope
6 | cin>>n>>d;
| ^~~
potatosalad.cpp:1:1: note: ‘std::cin’ is defined in header ‘<iostream>’; did you forget to ‘#include <iostream>’?
+++ |+#include <iostream>
1 |
potatosalad.cpp:11:19: error: expected ‘)’ before ‘;’ token
11 | sort(arr,arr+n;greater<int>())
| ~ ^
| )
potatosalad.cpp:11:20: error: ‘greater’ was not declared in this scope
11 | sort(arr,arr+n;greater<int>())
| ^~~~~~~
potatosalad.cpp:11:28: error: expected primary-expression before ‘int’
11 | sort(arr,arr+n;greater<int>())
| ^~~
potatosalad.cpp:15:9: error: ‘sum’ was not declared in this scope
15 | sum+=arr[i];
| ^~~
potatosalad.cpp:17