Compile Error
foo.cc: In function 'int main()':
foo.cc:11:48: error: invalid operands of types 'int' and '<unresolved overloaded function type>' to binary 'operator<<'
11 | cout<<(((n/500)*1000)+((n/5)*5)<<endl;
| ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
foo.cc:11:54: error: expected ')' before ';' token
11 | cout<<(((n/500)*1000)+((n/5)*5)<<endl;
| ~ ^
| )
foo.cc:14:30: error: expected ';' before ')' token
14 | cout<<(n/5)*5)<<endl;
| ^
| ;
Code
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
if(n>=500){
cout<<(((n/500)*1000)+((n/5)*5)<<endl;
}
else{
cout<<(n/5)*5)<<endl;
}
return 0;
}
Information
- Submit By
- Type
- Submission
- Problem
- P1132 B. Festivity Frenzy!
- Contest
- Brain Booster #8
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2025-02-17 14:57:01
- Judged At
- 2025-02-17 14:57:01
- Judged By
- Score
- 0
- Total Time
- 0ms
- Peak Memory
- 0 Bytes