分析下列程序,写出程序运行结果#includeint main(){char c1 = 'a', c2 = 'b', c3 = 'c';printf("a%cb%cc%cabc\n", c1, c2, c3);return 0;}
A.acbbcabc
B.acbcabc
C.aabcabc
D.aabbccabc
A.acbbcabc
B.acbcabc
C.aabcabc
D.aabbccabc
阅读下列程序并写出程序运行结果。
Private Sub Command1_Click()
x = 0
Do While x < 60
x = (x + 3) * (x + 4)
n = n + 1
Loop
Text1.Text = Str(n)
Text2.Text = Str(x)
Text3.Text = Val(Text1.Text) + Val(Text2.Text)
End Sub
写出程序运行后,文件框Text3的结果。
阅读下列程序并写出程序运行结果。
Private Sub Form_Click()
Dim x As Integer
Static y As Integer
x = x + 2
y = y + 3
Form1.Print "x="; x, "y="; y
End Sub
写出程序运行时连续单击三次窗体后,Form1上的输出结果。
阅读下列程序并写出程序运行结果。
Private Sub Form_Click()
Dim A(1 To 3) As String
Dim c As Integer
Dim j As Integer
A(1) = "4"
A(2) = "8"
A(3) = "12"
c = 1
For j = 1 To 3
c = c + Val(A(j))
Next j
Print c
End Sub
写出程序运行时单击窗体后,窗体Form1上的结果。
阅读下列程序,请写出程序的运行结果。
import java.applet.*;
import javax.swing.*;
import java.awt.event.*;
public class C extends Applet implements ActionListener
{
int n=0;
JButton button;
public void init()
{
setSize(400,100);
button=new JButton("");
add(button);
button.addActionListener(this);
}
public void actionPerformed(ActionEvent e)
{
n++;
button.setText(n+"");
}
}
阅读下列程序,请写出程序的运行结果。
public class C
{
public static void main(String[] args)
{
String text="public static void main(String[] args)";
int theCount=0;
int index=-1;
String theStr="i";
index=text.indexOf(theStr);
while(index>=0)
{
++theCount;
index+=theStr.length();
index=text.indexOf(theStr,index);
}
System.out.println("The Text contains"+theCount+"i");
}
}
写出下列程序的运行结果。
#include void Fun(){int num=20;cout<< "The Fun's num is"<< num<< endl;
}void main(){int num=10;cout<< "The main's num is "<< num<< endl;Fun();{int num=30;
cout<< "The Field's num is "<< num<< endl;}cout<< "The main's num is "<< num<< endl;}
阅读下列程序,写出程序运行结果。
import j ava. util. StringTokenizer;
public class C3301
{
public static void main(String[] args)
{
String ss="public static void main";
StringTokenizer pas=new StringTokenizer(ss, " ") ;
int n=pas. countTokens() ;
System. out. println(n) ;
String s=pas. nextToken() ;
for(pas. nextToken() ; pas. hasMorcTokens() ; s=pas. nextToken()
System. out. println(s) ;
}
}