System Testing
0 / 78
CE
0/78 test cases passed
Submission #22
| Problem | ValueAddedTax |
|---|---|
| Handle | guest-4b546a62 |
| Submitted | 2026-07-19 15:32:05 |
System Messages
main.cpp:982:5: error: conflicting declaration of C function 'int main(int, char**)'
982 | int main(int argc, char** argv) {
| ^~~~
In file included from main.cpp:4:
solution.cpp:27:5: note: previous declaration 'int main()'
27 | int main() {
| ^~~~
Source Code
// g++ -std=c++17 a.cpp -o a; ./a
#include <iostream>
#include <vector>
#include <string>
using namespace std;
#define ll long long
const int INF = 1e9;
const ll LINF = 1e18;
class ValueAddedTax {
public:
double calculateFinalPrice(string product, int price, vector<string> food)
{
for (int i=0;i<food.size();i++) {
if (product == food[i]) {
return (double) price + (double)price*0.1;
}
}
return (double) price + (double)price*0.18;
}
};
int main() {
ValueAddedTax a;
cout<<a.calculateFinalPrice("milk", 1, {"bread", "butter", "milk"})<<endl;
}