热门

最新

红包

立Flag

投票

同城

我的

发布
weixin_43883917
牛哄哄的柯南
5 年前
trueweixin_43883917

上课人,匆忙去上课

CSDN App 扫码分享
分享
2
4
打赏
  • 复制链接
  • 举报
下一条:
c++小白,跪求大佬为我解答疑惑。(下面是我编的代码显示编译错误试了好几遍还是一样的问题)#include <iostream> using namespace std; enum CPU_Rank {P1=1,P2,P3,P4,P5,P6,P7}; class CPU { public: CPU (); CPU(CPU_Rank r,float f,int v); ~CPU() void run(); void stop(); private: CPU_Rank rank; float frequency; int valtage; }; CPU::CPU() { rank=P1; frequency=3.6; valtage=220; } CPU::CPU(CPU_Rank r,float f,int v) { rank=r; frequency=f; valtage=v; void CPU::run() { cout<<CPU is running<<endl;} void CPU::stop() { cout<<CPU is stopping<<endl; } int main() { int i; CPU_Rank r; float f; int v; cin>>i>>f>>v; r=CPU_Rank(i); CPU myComputer(r,f,v); myComputer.run(); myComputer. stop(); return 0; }
立即登录