第1题
include<iostream>
define PI____3.14159
const int R=10;
void main()
{
double a,b;
ac2*R*PI;
b=R*R*PI;
cout<<"a="<<a<<","<<"b="<<b<<endl;"
}
第2题
include<iostream>
include<string>
using namespace std;
void main(){
chara[10]="China",b[]="Chin",c[]="ese";
cout<<strlen(strcat(strcpy(a,b),c))<<endl;
}
第3题
第4题
第6题
第8题
include <stdio.h>
main()
[ int i, n[4]={1};
for(i= 1 ;i<=3 ;i++)
{ n[i]=n[i-1]*2+1; printf("%d",n[i]); }
第9题
include<iostream>
using namespace std;
class base
{
public:
virmal void who(){cout<<"Base Class"<<endl;)
};
class Derivedl:public Base
{
public:
virtual void who(){cout<<"Derivedl Class"<<endl;}
};
class derived2:public Base
{
public:
virtual void who(){cout<<"Derived2 Class"<<endl;)
};
int main(int argc,char*argv[])
{
base obj1,*P;
deliVedl obj2;
derived2 obj3;
p=&obj1; p->who();
p=&obj2; p->who();
p=&obj3; p->who();
return 0;
}
第10题
include<iostream.h>
void main()
{
int a=0,b=1,c=0,d=20;
if(a) d=d-10;
else if(!b)
if(!c) d=15;
else d=25;
cout <<"d="<<d<<endl;
}
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!