更多“a = [1,2,3,4,5,6,7,8,9,0] ________ print(b)”相关问题
  • 第1题:

    (19)如果A为整数且|A|>=10,则打印“OK”,否则打印“Error”,表示这个条件的单行格式If语句是 A.If Int(A)=A And Sqr(A)>=10 Then Print“OK”Else Print “Error” B.If Fix(a)=A And Abs(a)>=10 Then Print“OK”Else Print “Error” C.If Int(A)=A And (A>=10 ,A=-10) Then Print“OK”Else Print “Error” D.If Fix(A)=A And A>=10, Abs A<=-10 Then Print“OK”Else Print “Error


    正确答案:B
    【解析】解答本题考生需了解题中用到的3个函数的作用,Int和Fix都会删除参数的小数部分而返回剩下的整数。Abs函数返回参数的绝对值,其类型和参数相同。而Int和Fix的不同之处在于,如果参数为负数,则Int返回小于或等于参数的第一个负整数,而Fix则会返回大于或等于参数的第一个负整数。

  • 第2题:

    如果A为整数且,|A|>=10,则打印“OK”,否则打印“Error”,表示这个条件的单行格式If语句是( )。

    A.If Int(A)=A And Sqr(A)>=10 Then Print"OK"Else Print "Error"

    B.If Fix(A)=a And Abs(A)>=-10 Then Print"OK"Else Print "Error"

    C.If Int(A)=A And(A>=10,A<-10) Then Print"OK"Else Print "Error"

    D.If Fix(A)=A And A>=10,And A<=-10 Then Print"OK" Else Print "Error"


    正确答案:B
    解析:解答本题考生需了解题中用到的3个函数的作用,Int和Fix都会删除参数的小数部分而返回剩下的整数。Abs函数返回参数的绝对值,其类型和参数相同。而Int和Fix的不同之处在于,如果参数为负数,则Int返回小于或等于参数的第一个负整数,而Fix则会返回大于或等于参数的第一个负整数。

  • 第3题:

    已知x代表某个百分制成绩,下列程序段用于显示对应的五级制成绩,正确的是( )

    A.If x>=60 Then Print"及格" Else If x>=70 Then Print"中" Else If x>=80 Then Print"良" Else If x>=90 Then Print"优" Else Print"不及格" End If

    B.If x<90 Then Print"良" Else If x<80 Then Print"中" Else If x<70 Then Print"及格" Else If x<60 Then Print"不及格" Else Print"优" End If

    C.If x>=90 then Print"优" Else If x>=80 Then Print"良" Else If x>=70 Then Print"中" Else If x>=60 Then Print"及格" Else Print"不及格" End If End Select

    D.Select Case x Case x>=90 Print"优" Case x>=80 Print"良" Case x>=70 Print"中" Case x>=60 Print"及格" Case Else Print"不及格"


    正确答案:C

  • 第4题:

    下面程序的输出结果是includemain(){int a[]={1,2,3,4,5,6,7,8,9,0},*p;p=a;printf("%

    下面程序的输出结果是 #include<stdio.h> main() { int a[]={1,2,3,4,5,6,7,8,9,0},*p; p=a; printf("%d\n",*p+9);}

    A.0

    B.1

    C.10

    D.9


    正确答案:C
    解析: 此题考查了指针引用一维数组元素的方法。*p+9因为运算符“*”的优先级高于“+”,所以输出结果为p指向的元素1,然后加9,值为10。

  • 第5题:

    有如下程序: include using namespace std; class TestClass { private: int x,y; pu

    有如下程序: #include<iostream> using namespace std; class TestClass { private: int x,y; public: TestClass (int i,int j) { x=i; y=j; } void print() { cout<<"print1"<<end1; } void print()const { cout<<"print2"<<end1; } }; int main() { const TestClass a(1,2); a.print(); return 0; } 该程序运行后的输出结果是( )。

    A.print1

    B.print2

    C.print1 print2

    D.程序编译时出错


    正确答案:B
    解析:由主函数main入手,定义TestClass型的常对象a,然后调用对象a中的成员函数print()。因为在C++中,如果一个对象被声明为常对象,则不能调用该对象中的非const型的成员函数。所以,这里调用的是对象中的const型成员函数“void print()const”,输出为print2。

  • 第6题:

    下面哪个程序段能够正确裙带如果A<B,则A=1,否则A=-1?

    A.If A<B Then A=1 A=-1 Print A

    B.If A<B Then A=l:Print A A=-1:PrintA

    C.If A<B Then A=1:Print A Else A=-1: End If

    D.If A<B Then A=1 A=-1 Print A Print A


    正确答案:C
    解析:本题考查的是IfThenElse结构,在此结构中可以有若干组语句块;题意是如果AB,则A=1,否则A=-1。

  • 第7题:

    有以下程序:include main( ){int a[ ] = { 1,2,3,4,5,6,7,8,9,0} , * p;for(p =a;p

    有以下程序:#include <stdio. h>main( ){ int a[ ] = { 1,2,3,4,5,6,7,8,9,0} , * p; for(p =a;p<a+10;p++) printf("%d," , *p); }程序运行后的输出结果是( )。

    A.1,2,3,4,5,6,7,8,9,0,

    B.2,3,4,5,6,7,8,9,10,1,

    C.0,1,2,3,4,5,6,7,8,9,

    D.1,1,1,1,1,1,1,1,1,1,


    正确答案:A
    解析:C语言规定数组名代表数组的首地址,所以for循环中循环变量p的初值即&a[o),故输出的*p的值为a[0]的值。执行p++后,指针变量P指向a[1],这时输出*P即输出a[1]的值,经过10次循环,将输出a数组的全部数据:1,2,3,4,5,6,7,8,9,0,

  • 第8题:

    在windows98中活动窗口打印的快捷键是()。

    • A、Ctrl+Print Screen
    • B、Shift+Print Screen
    • C、Alt+Print Screen
    • D、Print Screen

    正确答案:C

  • 第9题:

    An Information Technology (IT) staff has many calls from users who are unable to print or who lose print jobs.  After investigation, the IT staff has determined that the print spooler is stopping sporadically.  Which of the following actions in IBM Director would best resolve the issue?()

    • A、Create an Event Action Plan to monitor the NT Event Log for Print Spooler errors.Set a task to restart the print spooler when stopped.Apply this plan to print servers.
    • B、Using Event Management, create an Event Action Plan with a print spooler filter and set a task to restart the print spooler when stopped.  Apply this plan to print servers.
    • C、Using Resource Manager, create a threshold to monitor the print spooler queue.Create an Event Action Plan with a print spooler filter and set a task to restart the print spooler when the queue gets above 10 jobs.Apply this plan to print servers.
    • D、Using Process Management, create a threshold to monitor to set an error condition when the print spooler has stopped.Create an Event Action Plan using this filter and create a task to restart the print spooler when stopped. Apply plan to print servers.

    正确答案:D

  • 第10题:

    要查看一个结构类型变量的值,可以使用函数()

    • A、Print()
    • B、print()
    • C、Print_r()
    • D、print_r()

    正确答案:B

  • 第11题:

    判断题
    在visualbasic中,输入PRINT语句时,不论输入“PRINT”还是“print”,visualbasic都会转换为Print。
    A

    B


    正确答案:
    解析: 暂无解析

  • 第12题:

    单选题
    An Information Technology (IT) staff has many calls from users who are unable to print or who lose print jobs.  After investigation, the IT staff has determined that the print spooler is stopping sporadically.  Which of the following actions in IBM Director would best resolve the issue?()
    A

    Create an Event Action Plan to monitor the NT Event Log for Print Spooler errors.Set a task to restart the print spooler when stopped.Apply this plan to print servers.

    B

    Using Event Management, create an Event Action Plan with a print spooler filter and set a task to restart the print spooler when stopped.  Apply this plan to print servers.

    C

    Using Resource Manager, create a threshold to monitor the print spooler queue.Create an Event Action Plan with a print spooler filter and set a task to restart the print spooler when the queue gets above 10 jobs.Apply this plan to print servers.

    D

    Using Process Management, create a threshold to monitor to set an error condition when the print spooler has stopped.Create an Event Action Plan using this filter and create a task to restart the print spooler when stopped. Apply plan to print servers.


    正确答案: B
    解析: 暂无解析

  • 第13题:

    用Print方法在Form1窗体中显示出4个#号的正确代码为( )。

    A.Debug.Print"####"

    B.Print ####

    C.Form1 Print ####

    D.Form1.Print"####"


    正确答案:D
    解析:分析题目可知有两个要求:一是输出4们号;二是在Forml窗体中。选项A)实现的是在立即窗口中输出4个#号;选项B)实现的是在默认的对象中输出4们号;选项C)语法不对;只有选项D)是完全正确的。

  • 第14题:

    以下不能输出“Program”的语句是

    A.Print Mid(”VBProgram”,3,7)

    B.Print Right(”VBProgram”,7)

    C.Print Mid(”VBProgram”,3)

    D.Print Left(”VBProgram”,7)


    正确答案:D
    解析:Left础函数用于输出给定字符串左侧的字符,本题为取字符串左侧7个字符,选项D输出的结果应为“VBProgr”。

  • 第15题:

    下列不正确的语句是

    A.Print a=10+20

    B.Print "a=";10+20

    C.Print "a"="10+20"

    D.Print a=;10+20


    正确答案:D
    解析:Print方法用来输出文本或表达式的值。格式为: [对象名称.]Print[输出表列] 省略对象名称时,则在当前窗体上输出数据;输出表列是输出的常量、变量或表达式,两个输出项之间要使用分割符“,”或“;”。A项与C项输出表列都为表达式,B项中有两个输出项,前一项应该是字符串常量类型;故应加上引号,选项D的语句有误。

  • 第16题:

    以下能够正确退出循环的是( )。

    A.Print Not(3+5<4+6)

    B.Print 2>1 And 3<2

    C.Print 1>2 Or 2>3

    D.Print Not(1>2)


    正确答案:B
    B)【解析】本题考查Do型循环。对于这种循环结构,首先看条件判断在循环体的前面还是后面,如果是先判断条件,则有可能一次也不执行循环体;如果是后判断条件,则无论条件是否成立,至少执行一次循环体。由Until引出的循环条件为False时执行循环体,条件为True时退出循环;选项A)中循环变量在10的基础上逐渐增加,不可能小于10;选项B)中循环变量的步长为1,初值为l,可能到达10,然后退出循环。而选项C)和A)相似。选项D)中循环变量的步长为-3,不可能等于0。

  • 第17题:

    如果x为整数且|x|>=100,则打印“OK”,否则打印“Error”,表示这个条件的单行格式 If语句是

    A.If Int((x)=x And Sqr(x)>=100 Then Print "OK" Else Print "Error"

    B.If Fix(x)=x And Abs(x)>=100 Then Print"OK"Else Print"Error"

    C.If Int(x)=x And (x>=100,x<=-100)Then Print"OK"Else Print"Error"

    D.If Fix(x)=x And x>=100 And x<=-100 Then Print "OK" Else Print "Error"


    正确答案:B
    解析:绝对值函数为Abs,而取整函数为Fix或者Int。本题中,选项A使用了平方根函数;选项C书写错误;选项D的条件语句错误,x>=100Andx=-100这个条件永远不成立,应该为(x>=100Orx=-100)。正确答案为选项B。

  • 第18题:

    请写出下面的输出:

    class B

    {

    public:

    virtual void Print(void)

    {

    printf(“B::Print\n”);

    }

    virtual void Reprint(void)

    {

    printf(“B:Reprint\n”);

    }

    void Algo(void)

    {

    Print();

    Reprint();

    }

    };

    class D : public B

    {

    public:

    virtual void Print(void)

    {

    printf(“D::Print\n”);

    }

    };

    void main()

    {

    B *p = new D();

    p->Print();

    p->Algo();

    }


    正确答案:
     

  • 第19题:

    用Print方法在Form1窗体中显示出四个星号的正确代码为()。

    A.Print"****"

    B.Form1_Print"****"

    C.Form1.Print"****"


    答案:C

  • 第20题:

    Which of the following services processes print requests and sends them to the printer?()

    • A、Printer Driver
    • B、Print Spooler
    • C、Printer Service
    • D、Print Properties

    正确答案:B

  • 第21题:

    在visualbasic中,输入PRINT语句时,不论输入“PRINT”还是“print”,visualbasic都会转换为Print。


    正确答案:正确

  • 第22题:

    Memory utilization by the print spooler process is constantly climbing after users begin to print to acertain type of printer.  Which of the following is the MOST likely cause of the problem?()

    • A、 Corrupted print spooler software
    • B、 Memory leak in one of the print drivers
    • C、 The disk drive is out of free space
    • D、 Memory leak in the print spooler

    正确答案:B

  • 第23题:

    单选题
    已知函数print()没有返回值,如果在类中将之声明为常成员函数,正确的是(  )。
    A

    void print()const;

    B

    const void print();

    C

    void const print();

    D

    void print(const);


    正确答案: A
    解析:
    const成员函数说明格式如下:<返回类型><成员函数名>(<参数表>)const。

  • 第24题:

    单选题
    已知:print()函数是一个类的常成员函数,它无返回值,下列表示中,()是正确的。
    A

    void print()const

    B

    const void print()

    C

    void const print()

    D

    void print(const)


    正确答案: C
    解析: 暂无解析