#include <iostream> using namespace std; //在此处补充你的代码 class Derived : public Base { public: int Bar(char x) { return (int)(-x); } int Bar(int x) { return (x / 2);
时间: 2023-11-27 22:49:14 浏览: 246
#include <iostream>
缺少代码结尾的大括号和分号。完整代码应该是这样的:
```
#include <iostream>
using namespace std;
class Base {
public:
Base() {}
virtual ~Base() {}
};
class Derived : public Base {
public:
int Bar(char x) {
return (int)(-x);
}
int Bar(int x) {
return (x / 2);
}
};
```
阅读全文