第2题
A.(10101)2×(2)10=(20202)2
B.(10101)8×(8)10=(80808)8
C.(101010)8-(70707)8=(11011)8
D.(10101)8×(7)10=(70707)8
第3题
A.50,30
B.30,50
C.80,-20
D.80,20
第4题
A.5 8 12 15 30
B.12 15 5 30 18
C.8 12 15 30 18
D.12 15 5 18 30
第6题
阅读下列程序,请写出程序的运行结果。
import java.applet.*;
import java.awt.*;
public class C extends Applet implements Runnable
{
Thread redBall,blueBall;
Graphics redPen,bluePen;
int blueSeta=0,redSeta=0;
public void init()
{
setSize(250,200);
redBall=new Thread(this);
blueBall=new Thread(this);
redPen=getGraphics();
bluePen=getGraphics();
redPen.setColor(Color.red);
bluePen.setColor(Color.blue);
setBackground(Color.gray);
}
public void start()
{
redBall.start();
blueBall.start();
}
public void run()
{
intx,y;
while(true)
{
if(Thread.currentThread()==redBall)
{//以下代码为顺时针画圆
x=(int)(80.0*Math.cos(3.1415926/180.0*redSeta));
y=(int)(80.0*Math.sin(3.1415926/180.0*redSeta));
redPen.setColor(Color.gray);
redPen.fillOval(100+x,100+y,10,10);
redSeta+=3;
if(redSeta>=360)redSeta=0;
x=(int)(80.0*Math.cos(3.1415926/180.0*redSeta));
y=(int)(80.0*Math.sin(3.1415926/180.0*redSeta));
redPen.setColor(Color.red);
redPen.fillOval(100+x,100+y,10,10);
try{redBall.sleep(20);}
catch(InterruptedException e){}
}
elseif(Thread.currentThread()==blueBall)
{//以下代码为顺时针画圆
x=(int)(80.0*Math.cos(3.1415926/180.0*blueSeta));
y=(int)(80.0*Math.sin(3.1415926/180.0*blueSeta));
bluePen.setColor(Color.gray);
bluePen.fillOval(150+x,100+y,10,10);
blueSeta-=3;
if(blueSeta<=-360)blueSeta=0;
x=(int)(80.0*Math.cos(3.1415926/180.0*blueSeta));
y=(int)(80.0*Math.sin(3.1415926/180.0*blueSeta));
bluePen.setColor(Color.blue);
bluePen.fillOval(150+x,100+y,10;10);
try{blueBall.sleepp(40);}
catch(InterruptedException e){}
}
}
}
}
第7题
写出以下程序的运行结果。
#include int fun(int a){int b=0;static int c=3;b ; c ;return(a b c);}
main(){int i, a=5;for (i=0; i<3; i )cout<< i<< " "<< fun(a)<< " ";}
第8题
写出以下表达式的结果,一个结果一行:()6+5/4-22+2*(2*2-2)%2/310+9*((8+7)%6)+5*4%3*2+31+2+(3+4)*((5*6%7/8)-9)*10
第9题
阅读程序,写出运行结果。
#include <iostream.h>
int a=5;
void fun(int b)
static int a=10;
a+=b++;
cout<< a;
void main()
{
int c=20:
fun(c);
a+Fc++
cout<<a<<endl
}
第10题
A.'Hello'.islower()
B.'h' in 'Hello'
C.'b' in {'a':'b', 'c':'d', 'e':'f'}
D.eval('1')==int(1)