Ack(s);Push(s,D);Push(s,e);Pop(s,x);Pop(s,x);GetTop(s,x);选项格式
A.D
B.e
C.x
D.s
A.D
B.e
C.x
D.s
第2题
A.PC是一个可寻址的寄存器
B.单片机的主频越高,其运算速度越快
C.AT89S52单片机中的一个机器周期为1µs
D.特殊功能寄存器SP内存放的是堆栈栈顶单元的内容
第5题
第7题
阅读下列程序,请写出程序的运行结果。
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){}
}
}
}
}