Problem weddingcoins
User beefburger
Submission Time 2026-02-17 23:57:55
Score 0
Max Time N/A
Max Memory N/A

Compile Error

weddingcoins.cpp: In function ‘int main()’:
weddingcoins.cpp:25:8: error: expected ‘(’ before ‘n’
25 | while n {
| ^
| (
weddingcoins.cpp:25:9: error: expected ‘)’ before ‘{’ token
25 | while n {
| ~^~
| )
weddingcoins.cpp:26:21: error: invalid initialization of reference of type ‘std::vector<int>&’ from expression of type ‘std::vector<float>’
26 | amt = findClosest(money, n);
| ^~~~~
weddingcoins.cpp:5:30: note: in passing argument 1 of ‘int findClosest(std::vector<int>&, int)’
5 | int findClosest(vector<int>& v, int target) {
| ~~~~~~~~~~~~~^