更多"填上适当的语句,使求100以内能被3整除但不能被7整除的数字之和的程序"的相关试题:
[填空题]填上适当的语句,使求100以内能被3整除但不能被7整除的数字之和的程序完整正确。
SET TALK OFF
CLEAR
STORE O TO S,N
DO WHILE N<=i00
______
S=S+N
ENDIF
______
ENDDO
“S=”+STR(S)
SET TALK 0N
[填空题]下面程序是一个堆栈的类模板,在横线处填上适当语句,完成类模板的定义。
#define MAXSIZE 100
template <class T>
class Stack
T s[MAXSIZE];
int top;
public:
stack( )
top=1;
void push(T newValue)
if(top<MAXSIZE)
top=top+1;
s[top]=newValue;
else
cout<<"堆栈满,无法进栈"<<end1;
void pop( );
;
【12】
if(top>1)
cout<<s[top]<<end1;
top=top-1;
else
cout<<"堆栈空! "<<end1;
[填空题]在下面横线上填上适当的语句,完成程序。
#include <iostream>
using namespace std;
class Base
{
int x:
public:
Base (int i){x=i;}
~Base( ){}
};
class Derived : public Base
{
public:
______ //完成类Derive构造函数的定义
};
int main (
{
Derived Obi;
return 0;
}
在横线外应填入的语句是______。
[填空题]在下面横线上填上适当的语句,完成程序。
#include <iostream>
using namespace std;
class Base
{
int x;
public:
Base(int i) { x=i;}
~Base( ){}
};
class Derived: public Base
{
public:
______∥完成类 Derive构造函数的定义
};
int main( )
{
Derived Obj;
return 0;
}
在横线处应填入的语句是 【9】 。
[填空题]在下面横线上填上适当的语句,完成程序。
#include <iostream>
using namespace std;
class Base
int x;
public:
Base(int i) x=i;
~Base( )
;
class Derived: public Base
public:
______∥完成类 Derive 构造函数的定义
;
int main( )
Derived Obj;
return 0;
在横线处应填入的语句是 【11】 。
[填空题]在下面横线上填上适当的语句,完成程序。
#include <iostream>
using namespace std;
class Base
int x:
public:
Base (int i)x=i;
~Base( )
;
class Derived : public Base
public:
______ //完成类Derive构造函数的定义
;
int main (
Derived Obi;
return 0;
在横线外应填入的语句是______。
[填空题]在下面横线上填上适当的语句,完成程序。
#include<iostream>
using namespace std;
class Base
{
int x;
public:
Base(int 0{x=i;}
~Base( ){}
};
class Derived:public Base
{
public:
//完成类Derive构造函数的定义
};
int main( )
{
Derived Obj;
return 0;
}
[填空题]在下面横线上填上适当的语句,完成程序。
#include<iostream>
using namespace std;
class Base
int x;
public:
Base(int 0x=i;
~Base( )
;
class Derived:public Base
public:
//完成类Derive构造函数的定义
;
int main( )
Derived Obj;
return 0;
[填空题]在下面横线上填上适当的语句,完成程序。
#include <iostream>
using namespace std;
class Base
int x;
public:
Base(int i)x=i;
~Base( )
;
class Derived: public Base
public:
______ //完成类Derive构造函数的定义
;
int main( )
Derived Obj( );
return 0;