下列程序的执行结果是______。 class T5 implements Runnable { public void run() { int i = 0; While(i<2) { Thread t = Thread.currentThread(); System.out.println(i + t.getName()); i++ } } } public class Testl6 { public static void main(String[] args) { Thread t1 = new Thread(new T5(), "TS"); t1.start (); Thread t = Thread.currentThread(); for(int i = 0; i<3; i++) { System.out.println(I + t.getName()); if(i == 1 && t1.isAlive()) t.yield(); } } }
A.Omain lmam 0T5 1T5 2main
B.Omain lmam 2main
C.Omain lmain 2main 0T5 1T5
D.Omain lmain 0T5 1T5
第1题:
有以下程序,程序执行后,输出结果是【 】
include<stdio.h>
void fun(int*A)
{ a[0]=a[1];}
main()
{ int a[10]={10,9,8,7,6,5,4,3,2,1,},i;
for(i=2;i>1=0;i-) fun(&a[i]);
for(i=0;i<10;i++) printf("%d,a[i]);
printf("\n");
}
第2题:
第3题:
00330038003000301585067361821下列程序段执行结果是___________。 x = 1 print(type(x)) x = 1.0 print(type(x)) x = '1.0' print(type(x)
A.<class 'int'> <class 'float'> <class 'str'>
B.<class 'float'> <class 'int'> <class 'str'>
C.<class 'str'> <class 'float'> <class 'int'>
D.<class 'str'> <class 'int'> <class 'float'>
第4题:
分析以下程序的执行结果【 】。
include <iostream. h>
class S{
int A[10];
public:
int &operator () (int);
};
int &S: :operator() (int x) {
return A[x];
}
void main() {
S a;
int i,j;
for (i=0; i<10; i++)
a(i)=i*2;
for (i=0; i<10; i++)
cout<<a(i)<<" ";
cout<<end1; }
第5题:
第6题:
下列程序段执行结果是___________。 x = 1 print(type(x)) x = 1.0 print(type(x)) x = '1.0' print(type(x)
A.<class 'int'> <class 'float'> <class 'str'>
B.<class 'float'> <class 'int'> <class 'str'>
C.<class 'str'> <class 'float'> <class 'int'>
D.<class 'str'> <class 'int'> <class 'float'>