#include <iostream>
using namespace std;
class attack
{public:
attack(double T)
{
t=T;
}
void show()
{
if(t<10)
{
cout<<"暴走,攻击力加倍 ";
cout<<"攻击力为"<<2*t<<endl;
}
else if(t<100&&t>=10)
{
cout<<"屠戮,攻击力+10 ";
cout<<"攻击力为"<<(10+t)<<endl;
}
else if(t>=100&&t<500)
{
cout<<"噬魂,攻击力+50 ";
cout<<"攻击力为"<<(50+t)<<endl;
}
else if (t>=500&&t<1000)
{
cout<<"弑天,攻击力+200 ";
cout<<"攻击力为"<<(200+t)<<endl;
}
}
private:
double t;
};
class sword
{
public:
sword(string name,double length,double width,attack A):
n(name),l(length),w(width),a(A){}
void putsword()
{
cout<<"剑名:"<<n<<endl;
cout<<"剑长:"<<l<<endl;
cout<<"剑宽:"<<w<<endl;
a.show();
}
private:
string n;
double l;
double w;
attack a;
};
int main()
{
sword s("荒古遗尘长剑",10,4,600);
s.putsword();
sword c("别云剑——超有用",12,3,400);
c.putsword();
sword v("巴鲁姆克之光剑",6,2,80);
v.putsword();
sword h("华莱士巨剑",8,6,2);
h.putsword();
return 0;
}