1.#include
using namespace std;
int main()
{int x,n,m=1;
cout<<"enter x,n:"<cin>>x>>n;
if(n>=0)
{while(n) {m=m*x;n--;}
cout<else
{while(n) {m=m*x;n--;}
cout<<(1/m);}
}
2.#include
using namespace std;
class data
{
int y,m,d;
public:
data(int a,int b,int c) {y=a;m=b;d=c;}
data() {y=0;m=0;d=0;}
~data() {}
print() {cout<};
class people{
data birthday;
char bno,sex,sno;
public:
people(data k,char *b,char *s,char *sn):birthday(k)
{bno=*b;sex=*s;sno=*sn;}
people(people &p) {birthday=p.birthday;bno=p.bno;sex=p.sex;sno=p.sno;}
~people() {}
add(people x) {birthday=x.birthday;bno=x.bno;sex=x.sex;sno=x.sno;}
print() { cout<};
main()
{data m(1985,4,27);
people jia(m,"27","nv","230");
jia.print();}
请大家帮我看看哪里有问题
--------------------next---------------------
阅读(1037) | 评论(0) | 转发(0) |