菜鸟一个,不会改错啊。
#include "stdafx.h"#include <iostream>
using namespace std;
enum CPU_Rank{P1=1,P2,P3,P4,P5,P6,P7};
class RAM;
class CDROM;
class CPU
{
public:
CPU()
{rank=P1; frepuency=1; voltage=0.0;}
void run() {cout<<"run!!!"<<endl;}
void stop() {cout<<"stop!!!"<<endl;}
private:
CPU_Rank rank;
int frepuency;
float voltage;
};
class computer;
{
public:
void run() {cout<<"run!!!"<<endl;}
void stop() {cout<<"stop!!!"<<endl;}
private:
CPU cpu;
RAM ram;
CDROM cdrom;
};
int main()
{
CPU cpu;
cpu.run();
cpu.stop();
printf("Hello World!\n");
return 0;
}