1、以下代码的执行结果是() if -1: print("True.") else: print("False.")A.TrueB.FalseC.0D.-1
1、以下代码的执行结果是() if -1: print("True.") else: print("False.")
A.True
B.False
C.0
D.-1
参考答案和解析
12345
相关考题:
下列块结构条件语句,正确的是( )。A.If x>10 Then print"a" Else if x>5 Then print"b" Else if x<5 Then print"c" End ifB.if x>10 Then print"a" Else if x>5 Print"b" Else Print"c" End ifC.If x>10 Then print"a" Else if x>5 Then print"b" Else x<5 Then Print"c" End ifD.If x>10 Then Print"a" Else if x>5 Then print"b: Else Print"c" End if
(12)用Print方法在Form1窗体中显示4个#号的正确代码为 A.Debug.Print"####" B.Print####C.Form1_Print#### D.Form1.Print"####"
下列程序段的执行结果是( )。 a = 1: b = 0 Select Case a Case 1 Select Case b Case 0 Print "**0**" Case 1 Print "**1**" End Select Case 2 Print "**2**" End Select A. **0**B. **1**C. **2**D. 0
以下程序的执行结果是【】。 include include void pnnt(int n) { if (n!=0 以下程序的执行结果是【 】。include<iostream.h>include<iomanip.h>void pnnt(int n){if (n!=0){Print(n-1);for (int i=1;i<=n;i++)cout<<setw(3)<<i;cout<<endl;}}void main(){print(4);}
有以下程序:#includestdio.hmain( ){ int a=1,b=0;if(--a)b++;else if(a==0)b+=2;else b+=3:print[(%d\n,b);}程序运行后的输出结果是( )。A.0B.1C.2D.3
用Print方法在Form1窗体中显示出4个#号的正确代码为( )。A.Debug.Print"####"B.Print ####C.Form1 Print ####D.Form1.Print"####"
以下程序的执行结果是______ include include void print(int n) { if(n 以下程序的执行结果是______include<iostream.h>include<iomanip.h>void print(int n){if(n!=0){print(n-1);for(int i=1;i<=n;i++=cout<<setw(3)<<i;cout<<endl;}}void main(){print (4);}
运行下面程序后,正确的输出结果是 ______。Private Sub Command1_ Click() x = 6 if x >6 then Print "x>6": Else if x <8 then Print "x<8"; Else if x = 6 then Print "x=6": End if End if End ifEnd SubA.x<8 x=6B.x<8C.x=6D.x<8或x=6
编译和执行以下代码,输出结果是( )。 int i=1; switch (i) { case 0: System.out.print("zero,"); break; case 1: System.out.print("one,"); case 2: System.out.print("two,"); default: System.out.println("default"); }A.one,B.one,two,C.one,two,defaultD.default
已知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 IfB.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 IfC.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 SelectD.Select Case x Case x>=90 Print"优" Case x>=80 Print"良" Case x>=70 Print"中" Case x>=60 Print"及格" Case Else Print"不及格"
下面哪个程序段能够正确裙带如果A<B,则A=1,否则A=-1?A.If A<B Then A=1 A=-1 Print AB.If A<B Then A=l:Print A A=-1:PrintAC.If A<B Then A=1:Print A Else A=-1: End IfD.If A<B Then A=1 A=-1 Print A Print A
如果A为整数且|A|>=100,则打印“OK”,否则打印“Error”,表示这个条件的单行格式If语句是A.If Int(A)=A And Sqr(A)>=100 Then Print "OK" Else Print "Error"B.If Fix(A)=A And ABS(A)>=100 Then Print "OK" Else Print "Error"C.If Int(A)=A And(A>=100,A<=-100)Then Print "OK: Else Print "Error"D.If FiX(A)=AAnd A>=100 And A<=-100 Then Print "OK" E1se Print "Error"
如果在立即窗口中执行以下操作:M=1 (是回车键)N=2 PRINT M> =N 则输出结果是()。 如果在立即窗口中执行以下操作: M=1 <CR>(<CR>是回车键) N=2 <CR> PRINT M> =N <CR> 则输出结果是( )。A.-1B.0C.FALSED.TRUE
class Waiting implements Runnable { boolean flag = false; public synchronized void run() { if (flag) { flag = false; System.out.print("1 "); try { this.wait(); } catch (Exception e) { } System.out.print("2 "); } else { flag = true; System.out.print("3 "); try { Thread.sleep(2000); } catch (Exception e) { } System.out.print("4 "); notify(); } } public static void main(String [] args) { Waiting w = new Waiting(); new Thread(w).start(); new Thread(w).start (); } } 以下哪两项是正确的?() A、代码输出 1 3 4B、代码输出 3 4 1C、代码输出 1 2 3 4D、代码不会完成
多选题现有: class Waiting implements Runnable { boolean flag=false; public synchronized void run() { if (flag) { flag=false; System.out.print ("1"); try { this.wait(); ) catch (Exception e) { } System.out.print ("2"); } else { flag=true; System.out.print ("3"); try{Thread.sleep (2000); } catch(Exception e) {} System.out.print ("4"); notify(); } } public static void main (String [] args) { Waiting w=new Waiting(); new Thread (w) .start(); new Thread (w) .start(); } } 以下哪两项是正确的?()A代码输出l 3 4B代码输出3 4 1C代码输出l 2 3 4D代码输出1 3 4 2E代码运行完毕F代码不会完成
多选题class Waiting implements Runnable { boolean flag = false; public synchronized void run() { if (flag) { flag = false; System.out.print("1 "); try { this.wait(); } catch (Exception e) { } System.out.print("2 "); } else { flag = true; System.out.print("3 "); try { Thread.sleep(2000); } catch (Exception e) { } System.out.print("4 "); notify(); } } public static void main(String [] args) { Waiting w = new Waiting(); new Thread(w).start(); new Thread(w).start (); } } 以下哪两项是正确的?()A代码输出 1 3 4B代码输出 3 4 1C代码输出 1 2 3 4D代码不会完成