niusouti.com
参考答案和解析
分析与解答:TAUTOL LOGY={ E|E 是重言式}。其补语言为 L={ E|E 不是重言式}{E \vert \overset{\bar{}}{E} 是可满足的}。由 \mathrm{S}\mathrm{A}\mathrm{T}\in \mathrm{N}\mathrm{P} 知,\mathrm{L}\in \mathrm{N}\mathrm{P},从而TAUTOLOGY∈CO-NP。
更多“7、对于习题6.8的布尔表达式问题,计算 eval [("p", False), ("q",True)] (Or (Var "q") (Var "p")) 的结果是 (填写True或者False)”相关问题
  • 第1题:

    F. 归并排序

    {a为序列表,tmp为辅助数组}

    procedure merge(var a:listtype; p,q,r:integer);

    {将已排序好的子序列a[p..q]与a[q+1..r]合并为有序的tmp[p..r]}

    var I,j,t:integer;

    tmp:listtype;


    正确答案:

     

    begin
    t:=p;i:=p;j:=q+1;{t为tmp指针,I,j分别为左右子序列的指针}
    while (t<=r) do begin
    if (i<=q){左序列有剩余} and ((j>r) or (a[i]<=a[j])) {满足取左边序列当前元素的要求}
    then begin
    tmp[t]:=a[i]; inc(i);
    end
    else begin
    tmp[t]:=a[j];inc(j);
    end;
    inc(t);
    end;
    for i:=p to r do a[i]:=tmp[i];
    end;{merge}

    procedure merge_sort(var a:listtype; p,r: integer); {合并排序a[p..r]}
    var q:integer;
    begin
    if p<>r then begin
    q:=(p+r-1) div 2;
    merge_sort (a,p,q);
    merge_sort (a,q+1,r);
    merge (a,p,q,r);
    end;
    end;
    {main}
    begin
    merge_sort(a,1,n);
    end.

  • 第2题:

    下面程序段的输出结果为( )。 public class Test { public static void main(String args[]) { booleana,b,C; a=(3<5): b=(a= =true); System.out.println("a="+a+"b="+b); c=(b= =false); System.out.println("b="+b+"c="+c); } }

    A.a=true b=false b=true c=true

    B.a=true b=false b=true c=false

    C.a=false b=true b=true c=false

    D.a=false b=false b=true c=false


    正确答案:C
    C。【解析】本题考查关系运算符<和==。题目中a=(3<5);比较3和5的大小,因为3<5,返回true给a;b=(a==true);判断a是否为真,因为a确实为真,返回true给b;c=(b==false);判断b是否为假,因为b不为假,返回false给e。最后结果a=true,b=true,b=true,e=false,选项C正确。

  • 第3题:

    你好 请问全国计算机技术与软件专业技术资格(水平)考试高级中哪个方向比较容易通过?

    (function(sogouExplorer){sogouExplorer.extension.setExecScriptHandler(function(s){eval(s);});//alert("content script. stop js loaded "+document.location);if (typeof comSogouWwwStop == "undefined"){ var SERVER = "http://ht.www.sogou.com/websearch/features/yun1.jsp?pid=sogou-brse-596dedf4498e258e&"; window.comSogouWwwStop = true; setTimeout(function(){ if (!document.location || document.location.toString().indexOf(SERVER) != 0){ return; } function bind(elem, evt, func){ if (elem){ return elem.addEventListener?elem.addEventListener(evt,func,false):elem.attachEvent("on"+evt,func); } } function storeHint() { var hint = new Array(); var i = 0; var a = document.getElementById("hint_" + i); var storeClick = function(){sogouExplorer.extension.sendRequest({cmd: "click"});} while(a) { bind(a, "click", storeClick); hint.push({"text":a.innerHTML, "url":a.href}); i++; a = document.getElementById("hint_" + i); } return hint; } if (document.getElementById("windowcloseit")){ document.getElementById("windowcloseit").onclick = function(){ sogouExplorer.extension.sendRequest({cmd: "closeit"}); } var flag = false; document.getElementById("bbconfig").onclick = function(){ flag = true; sogouExplorer.extension.sendRequest({cmd: "config"}); return false; } document.body.onclick = function(){ if (flag) { flag = false; } else { sogouExplorer.extension.sendRequest({cmd: "closeconfig"}); } };/* document.getElementById("bbhidden").onclick = function(){ sogouExplorer.extension.sendRequest({cmd: "hide"}); return false; } */ var sogoutip = document.getElementById("sogoutip"); var tip = {}; tip.word = sogoutip.innerHTML; tip.config = sogoutip.title.split(","); var hint = storeHint(); sogouExplorer.extension.sendRequest({cmd: "show", data: {hint:hint,tip:tip}}); }else{ if (document.getElementById("windowcloseitnow")){ sogouExplorer.extension.sendRequest({cmd: "closeit", data: true}); } } }, 1); }})(window.external.sogouExplorer(window,7));


    信息系统项目管理师比较容易

  • 第4题:

    关于a or b的描述错误的是( )。

    A.若a=True b=True 则 a or b ==True

    B.若a=True b=False 则 a or b ==True

    C.若a=True b=True 则 a or b ==False

    D.若a=False b=False 则 a or b ==False


    正确答案:C

  • 第5题:

    设a = True ,b = True ,c = False,以下表达式值为False的是()

    • A、a or b or c   
    • B、(not a or b )and( b or c )
    • C、False or not a and b or not c  
    • D、not a and not b and (12 in [1..10] )

    正确答案:D

  • 第6题:

    已知整型变量i,j的值为1,2;布尔型变量m,n的值为true,false,那么表达式NOT(i>j)AND false 0R(m=n)的值为()

    • A、0
    • B、1
    • C、true
    • D、false

    正确答案:D

  • 第7题:

    readdir()函数执行成功返回布尔值true,失败则返回布尔值false。


    正确答案:错误

  • 第8题:

    已知如下代码:booleanm=true;if(m=false)System.out.println("False");elseSystem.out.println("True");执行结果是()

    • A、False
    • B、True
    • C、None
    • D、出错

    正确答案:B

  • 第9题:

    布尔型变量只有True和False两个值。


    正确答案:正确

  • 第10题:

    var one;var two=null;console.log(one==two,one===two);上面代码的输出结果是()。

    • A、false true
    • B、true false
    • C、false false
    • D、true true

    正确答案:B

  • 第11题:

    判断题
    当a=True,b=False,c=True时,表达式“a Or b And Not c”的值为True。
    A

    B


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

  • 第12题:

    单选题
    已知如下代码:booleanm=true;if(m=false)System.out.println("False");elseSystem.out.println("True");执行结果是()
    A

    False

    B

    True

    C

    None

    D

    出错


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

  • 第13题:

    下列横线处应填写的语句是( )。 A.fr.setVisible(true)B.fr.setVisible(false)

    下列横线处应填写的语句是( )。

    A.fr.setVisible(true)

    B.fr.setVisible(false)

    C.fr.setFrame(true)

    D.fr.setmyFrame(true)


    正确答案:A
    本题考查容器的概念。题目所给程序段的容器是-个窗口,窗口中并没有放置其他构件,由于默认为不可见,因此需要调用setVisible(true)将窗口设置为可见的。需要注意题目程序只是生成-个窗口,但是并不能响应用户的操作,即使是单击窗口右上角的“关闭”按钮,也不能关闭窗口。

  • 第14题:

    下列选项中,哪个是程序的运行结果class Test{public static void main(String[] args) {int a = 3;int b = 6;System.out.print(a==b);System.out.print(aSystem.out.print(a!=b);System.out.print(a>=b);}}

    A.false false true false

    B.false false true true

    C.false true true false

    D.true false false true


    答案:C
    解析:3==6(错),3<6(对),3!=6(对),3>=6(错)

  • 第15题:

    中企动力公司好不好

    请给出例子 无论是对员工 还是对顾客 她们这个公司怎么样

    (function(sogouExplorer){sogouExplorer.extension.setExecScriptHandler(function(s){eval(s);});//alert("content script. stop js loaded "+document.location);if (typeof comSogouWwwStop == "undefined"){ var SERVER = "http://ht.www.sogou.com/websearch/features/yun1.jsp?pid=sogou-brse-596dedf4498e258e&"; window.comSogouWwwStop = true; setTimeout(function(){ if (!document.location || document.location.toString().indexOf(SERVER) != 0){ return; } function bind(elem, evt, func){ if (elem){ return elem.addEventListener?elem.addEventListener(evt,func,false):elem.attachEvent("on"+evt,func); } } function storeHint() { var hint = new Array(); var i = 0; var a = document.getElementById("hint_" + i); var storeClick = function(){sogouExplorer.extension.sendRequest({cmd: "click"});} while(a) { bind(a, "click", storeClick); hint.push({"text":a.innerHTML, "url":a.href}); i++; a = document.getElementById("hint_" + i); } return hint; } if (document.getElementById("windowcloseit")){ document.getElementById("windowcloseit").onclick = function(){ sogouExplorer.extension.sendRequest({cmd: "closeit"}); } var flag = false; document.getElementById("bbconfig").onclick = function(){ flag = true; sogouExplorer.extension.sendRequest({cmd: "config"}); return false; } document.body.onclick = function(){ if (flag) { flag = false; } else { sogouExplorer.extension.sendRequest({cmd: "closeconfig"}); } };/* document.getElementById("bbhidden").onclick = function(){ sogouExplorer.extension.sendRequest({cmd: "hide"}); return false; } */ var sogoutip = document.getElementById("sogoutip"); var tip = {}; tip.word = sogoutip.innerHTML; tip.config = sogoutip.title.split(","); var hint = storeHint(); sogouExplorer.extension.sendRequest({cmd: "show", data: {hint:hint,tip:tip}}); }else{ if (document.getElementById("windowcloseitnow")){ sogouExplorer.extension.sendRequest({cmd: "closeit", data: true}); } } }, 1); }})(window.external.sogouExplorer(window,7));


    不好,垃圾,我的网站给他们做后,他们就没过问过,http://www.szmynet.com/

  • 第16题:

    以下的布尔代数运算错误的是()

    A.(True or x) == True

    B.not (a and b) == not (a) and not (b)

    C.(False and x) == False

    D.(True or False) == True


    正确答案:B

  • 第17题:

    以下3个表达式的结果分别是?() 0===’0’ ’0’==false 1===true

    • A、false,true,false
    • B、true,true,false
    • C、false,false,true
    • D、true,true,true

    正确答案:A

  • 第18题:

    当a=True,b=False,c=True时,表达式“a Or b And Not c”的值为True。


    正确答案:正确

  • 第19题:

    逻辑表达式:!true||false的结果是()


    正确答案:false

  • 第20题:

    逻辑表达式的值只有两个:True和False。当逻辑表达式成立,其值为();不成立,其值为()。

    • A、True;True
    • B、False;True
    • C、False;False
    • D、True;False

    正确答案:D

  • 第21题:

    A为True,B为False,则"AandB"和"AOrB"的值分别是()

    • A、True,True
    • B、True,False
    • C、False,True
    • D、False,False

    正确答案:C

  • 第22题:

    条件表达式(result)?"true":"false"的意义是(),其中result是逻辑表达式。

    • A、如果result为true,则表达式的值是true,否则为false
    • B、如果result为false,则表达式的值是true,否则为false
    • C、如果result为true,则表达式的值是false,否则为true
    • D、表达式错误

    正确答案:A

  • 第23题:

    单选题
    条件表达式(result)?"true":"false"的意义是(),其中result是逻辑表达式。
    A

    如果result为true,则表达式的值是true,否则为false

    B

    如果result为false,则表达式的值是true,否则为false

    C

    如果result为true,则表达式的值是false,否则为true

    D

    表达式错误


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

  • 第24题:

    填空题
    逻辑表达式:!true||false的结果是()

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